Bug 838988 - Incorrect download status in nsIRequest::OnStopRequest r=honza
authorJason Duell <jduell.mcbugs@gmail.com>
Thu, 07 Feb 2013 20:36:00 -0800
changeset 123117 17d25f2c3c3899e538c026638e2e14fac1ab0ff4
parent 123116 ca131cc6fdac33a7ebcbcfd6e1f69a52ba24e982
child 123118 63a6466d8c466a5562c7ec478fc8d557d4723f7e
push id24372
push useremorley@mozilla.com
push dateWed, 27 Feb 2013 13:22:59 +0000
treeherdermozilla-central@0a91da5f5eab [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershonza
bugs838988
milestone22.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 838988 - Incorrect download status in nsIRequest::OnStopRequest r=honza
netwerk/base/src/nsInputStreamPump.cpp
--- a/netwerk/base/src/nsInputStreamPump.cpp
+++ b/netwerk/base/src/nsInputStreamPump.cpp
@@ -521,16 +521,18 @@ nsInputStreamPump::OnStateTransfer()
         else if (avail) {
             // if stream is now closed, advance to STATE_STOP right away.
             // Available may return 0 bytes available at the moment; that
             // would not mean that we are done.
             // XXX async streams should have a GetStatus method!
             rv = mAsyncStream->Available(&avail);
             if (NS_SUCCEEDED(rv))
                 return STATE_TRANSFER;
+            if (rv != NS_BASE_STREAM_CLOSED)
+                mStatus = rv;
         }
     }
     return STATE_STOP;
 }
 
 uint32_t
 nsInputStreamPump::OnStateStop()
 {