bugGNU Wget - Bugs: bug #41316, Output Logging time math uses 100...

 
 

bug #41316: Output Logging time math uses 100 seconds to represent a minute

Submitted by:  ez goen <ezgoen>
Submitted on:  Wed 22 Jan 2014 11:38:49 PM UTC  
 
Category: Program LogicSeverity: 3 - Normal
Priority: 5 - NormalStatus: Invalid
Privacy: PublicAssigned to: None
Originator Name: Martin WanickiOpen/Closed: Closed
Release: 1.13.4Operating System: GNU/Linux
Reproducibility: Every TimeFixed Release: None
Planned Release: NoneRegression: None
Work Required: NonePatch Included: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 08 Jun 2014 02:44:09 PM UTC, comment #2:

Closing due to no activity and does not look like a bug to me.

Darshit Shah <darnir>
Project Administrator
Fri 21 Feb 2014 10:18:20 AM UTC, comment #1:

I'm not sure of what the error is here. The output seems completely legitimate to me.

Also, here is the code snippet that computes the human readable ETA:

if (secs < 100)
sprintf (buf, "%ds", secs);
else if (secs < 100 * 60)
sprintf (buf, "%dm%s%ds", secs / 60, space, secs % 60);
else if (secs < 48 * 3600)
sprintf (buf, "%dh%s%dm", secs / 3600, space, (secs / 60) % 60);
else if (secs < 100 * 86400)
sprintf (buf, "%dd%s%dh", secs / 86400, space, (secs / 3600) % 24);
else
/* even (2^31-1)/86400 doesn't overflow BUF. */
sprintf (buf, "%dd", secs / 86400);

I don't see anything wrong with this math. If you still belive there's something wrong, please let us know

Darshit Shah <darnir>
Project Administrator
Wed 22 Jan 2014 11:38:49 PM UTC, original submission:

Here's a snip from a typical output:

5500K .......... .......... .......... .......... .......... 8% 16.1K 1h40m
5550K .......... .......... .......... .......... .......... 8% 11.9K 1h40m
5600K .......... .......... .......... .......... .......... 8% 12.0K 99m52s
5650K .......... .......... .......... .......... .......... 9% 13.9K 99m30s
5700K .......... .......... .......... .......... .......... 9% 19.9K 98m58s

its clear the time math has not been correctly implemented
the math should be something like
hours = timeremaining div 60 (/)
mins = timeremaining mod 60 (%)

Of course timeremaining could be msecs so some extra bits might be needed
I haven't looked into the code to see whats gone wrong

ez goen <ezgoen>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by darnir (Posted a comment)
  • -unavailable- added by ezgoen (Submitted the item)
  •  

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 08 Jun 2014 02:44:09 PM UTCdarnirStatusNone=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup