Closed
Bug 162177
Opened 23 years ago
Closed 23 years ago
error in the downloading windows
Categories
(SeaMonkey :: Download & File Handling, defect)
SeaMonkey
Download & File Handling
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: regisr, Assigned: bugzilla)
Details
Attachments
(1 file, 2 obsolete files)
|
763 bytes,
patch
|
jag+mozilla
:
review+
dmosedale
:
superreview+
asa
:
approval1.4+
|
Details | Diff | Splinter Review |
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
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?
Comment 4•23 years ago
|
||
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
Comment 5•23 years ago
|
||
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.
Comment 8•23 years ago
|
||
Adding review keyword so that someone hopefully takes a look at the patch
Keywords: review
Updated•23 years ago
|
QA Contact: sairuh → petersen
Comment 9•23 years ago
|
||
nominating for 1.4b: a small bug that allready has patch (patch needs reviewing)
Flags: blocking1.4b?
Comment 10•23 years ago
|
||
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-
Comment 11•23 years ago
|
||
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?
Comment 12•23 years ago
|
||
Attachment #94883 -
Attachment is obsolete: true
Comment 13•23 years ago
|
||
Attachment #121875 -
Attachment is obsolete: true
Comment 14•23 years ago
|
||
Comment on attachment 121879 [details] [diff] [review]
new cleaner patch, thanks to dmose
sr=dmose
Attachment #121879 -
Flags: superreview+
Comment 15•23 years ago
|
||
Use Math.floor, not parseInt, and we'll reconsider for 1.4final.
/be (typing as Asa)
Flags: blocking1.4? → blocking1.4-
Comment 16•23 years ago
|
||
brendan: The patch doesn't use parseInt(), it uses toFixed()
(parseInt was part of the orignial problem)
Flags: blocking1.4- → blocking1.4?
Comment 17•23 years ago
|
||
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 18•23 years ago
|
||
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 19•23 years ago
|
||
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+
Comment 20•23 years ago
|
||
Checking in nsProgressDialog.js;
/cvsroot/mozilla/embedding/components/ui/progressDlg/nsProgressDialog.js,v <--
nsProgressDialog.js
new revision: 1.28; previous revision: 1.27
done
Comment 21•23 years ago
|
||
fixed. yay.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 22•23 years ago
|
||
Verified on 2003-06-05-08 win32 and macho trunk builds
Status: RESOLVED → VERIFIED
Updated•21 years ago
|
Product: Browser → Seamonkey
You need to log in
before you can comment on or make changes to this bug.
Description
•