Closed Bug 162177 Opened 23 years ago Closed 23 years ago

error in the downloading windows

Categories

(SeaMonkey :: Download & File Handling, defect)

defect
Not set
trivial

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: regisr, Assigned: bugzilla)

Details

Attachments

(1 file, 2 obsolete files)

From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.0.0) Gecko/20020802 BuildID: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.0.0) Gecko/20020802 During downloading the speed was incorrectly displayed: (2.8 KB/sec 2.9 KB/sec 2.10KB/sec 3.1KB/sec ... ) the 2.10 sould be 3.0 ;-) Reproducible: Didn't try Steps to Reproduce: 1.download a big file 2. 3. Expected Results: Display 3.0 instead of 2.10
could also be a temporary lag...
URL: Not usefull
hm. math. fun. this is how the download manager does it: (nsDownloadProgressListener.js) // rate is bytes/sec var kRate = rate / 1024; // K bytes/sec; kRate = parseInt( kRate * 10 + .5 ); // xxx (3 digits) [..] var fraction = kRate % 10; kRate = parseInt( ( kRate - fraction ) / 10 ); [..] rateMsg = replaceInsert( rateMsg, 1, kRate + "." + fraction ); and the old progressdialog: (nsProgressDialog.js) rateToKRate: function( rate ) { var kRate = rate / 1024; // KBytes/sec var fraction = parseInt( ( kRate - ( kRate = parseInt( kRate ) ) ) * 10 + 0.5 ); return kRate + "." + fraction; } the old one seems rather complicated compared to the new (downloadmanager) one. blake, got a comment? oh, and the indentation in nsDownloadProgressListener.js is off by one space.
reporter: btw, did you see this in the single-file progress dialog, or the download manager window?
ok.. we have it: the nsProgressDialog.js function returns 2.10, if it get's rate=3020 for example. Problem: I'm not sure, if the new code is also 100% secure against errors, where a x.99 shown as x.9 and not as x+1.0, but I can't get it to fail.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: FreeBSD → All
Hardware: PC → All
ok, here comes my version of that: var kRate = Math.round(rate/1024*10); var fraction = kRate % 10; kRate = parseInt(kRate / 10 ); return kRate + "." + fraction; ..what did I miss?
alge@samsen.com asked me where I see this error: it was in the single-file progress window.
Adding review keyword so that someone hopefully takes a look at the patch
Keywords: review
QA Contact: sairuh → petersen
nominating for 1.4b: a small bug that allready has patch (patch needs reviewing)
Flags: blocking1.4b?
This looks like a good one to get. Blake said that the patch looked fine but we'd need to get reviews on it. We're not going to hold the 1.4b release for it though.
Flags: blocking1.4b? → blocking1.4b-
There should be amble time for a review during the final cycle.I think we should really try and get those bugs with patches checked in.
Flags: blocking1.4?
Attached patch same patch, now with diff -u (obsolete) — Splinter Review
Attachment #94883 - Attachment is obsolete: true
Attachment #121875 - Attachment is obsolete: true
Comment on attachment 121879 [details] [diff] [review] new cleaner patch, thanks to dmose sr=dmose
Attachment #121879 - Flags: superreview+
Use Math.floor, not parseInt, and we'll reconsider for 1.4final. /be (typing as Asa)
Flags: blocking1.4? → blocking1.4-
brendan: The patch doesn't use parseInt(), it uses toFixed() (parseInt was part of the orignial problem)
Flags: blocking1.4- → blocking1.4?
not gonna block 1.4 for this but if we can get a review (from jag?) then seek approval to land the patch by setting the approval1.4? flag and drivers will evaluate for landing.
Flags: blocking1.4? → blocking1.4-
Attachment #121879 - Flags: review?(jaggernaut)
Comment on attachment 121879 [details] [diff] [review] new cleaner patch, thanks to dmose r=jag Much much better. How about using this in other places that try to do this?
Attachment #121879 - Flags: review?(jaggernaut)
Attachment #121879 - Flags: review+
Attachment #121879 - Flags: approval1.4?
Comment on attachment 121879 [details] [diff] [review] new cleaner patch, thanks to dmose a=asa (on behalf of drivers) for checkin to 1.4
Attachment #121879 - Flags: approval1.4? → approval1.4+
Checking in nsProgressDialog.js; /cvsroot/mozilla/embedding/components/ui/progressDlg/nsProgressDialog.js,v <-- nsProgressDialog.js new revision: 1.28; previous revision: 1.27 done
fixed. yay.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Verified on 2003-06-05-08 win32 and macho trunk builds
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: