mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-04 04:58:00 +00:00
Bug 451991 - nsIProgressEventSink::OnProgress reports wrong values when uploading, r+sr=biesi
This commit is contained in:
parent
ef06fa9b7b
commit
d9a98bcf71
@ -4601,8 +4601,10 @@ nsHttpChannel::OnTransportStatus(nsITransport *trans, nsresult status,
|
||||
mProgressSink->OnStatus(this, nsnull, status,
|
||||
NS_ConvertUTF8toUTF16(host).get());
|
||||
|
||||
if (progress > 0)
|
||||
if (progress > 0) {
|
||||
NS_ASSERTION(progress <= progressMax, "unexpected progress values");
|
||||
mProgressSink->OnProgress(this, nsnull, progress, progressMax);
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG
|
||||
else
|
||||
|
@ -366,6 +366,13 @@ nsHttpTransaction::OnTransportStatus(nsresult status, PRUint64 progress)
|
||||
if (!mHasRequestBody)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsISeekableStream> seekable = do_QueryInterface(mRequestStream);
|
||||
NS_ASSERTION(seekable, "Request stream isn't seekable?!?");
|
||||
|
||||
PRInt64 prog = 0;
|
||||
seekable->Tell(&prog);
|
||||
progress = prog;
|
||||
|
||||
// when uploading, we include the request headers in the progress
|
||||
// notifications.
|
||||
progressMax = mRequestSize; // XXX mRequestSize is 32-bit!
|
||||
|
Loading…
x
Reference in New Issue
Block a user