Bug 998608 - Intermittent netwerk/test/unit/test_range_requests.js | request reports itself as not pending from onDataAvailable, r=michal
authorHonza Bambas <honzab.moz@firemni.cz>
Sat, 17 May 2014 15:38:50 +0200
changeset 202889 b150cef6f31d4dcf7c9171e491bd61d2d28215f5
parent 202888 020e705e89ba3120ae235fa565b99323d92de570
child 202890 795c41afe2a651f7338470364163b39c022ad4e0
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmichal
bugs998608
milestone32.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 998608 - Intermittent netwerk/test/unit/test_range_requests.js | request reports itself as not pending from onDataAvailable, r=michal
netwerk/protocol/http/nsHttpChannel.cpp
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -2176,16 +2176,17 @@ nsHttpChannel::ProcessPartialContent()
         if (NS_FAILED(rv)) return rv;
 
         UpdateInhibitPersistentCachingFlag();
 
         rv = UpdateExpirationTime();
         if (NS_FAILED(rv)) return rv;
 
         mCachedContentIsPartial = false;
+        mConcurentCacheAccess = 0;
 
         // notify observers interested in looking at a response that has been
         // merged with any cached headers (http-on-examine-merged-response).
         gHttpHandler->OnExamineMergedResponse(this);
     }
     else {
         // suspend the current transaction
         rv = mTransactionPump->Suspend();
@@ -5136,18 +5137,16 @@ nsHttpChannel::OnStopRequest(nsIRequest 
 
         if (mUpgradeProtocolCallback && stickyConn &&
             mResponseHead && mResponseHead->Status() == 101) {
             gHttpHandler->ConnMgr()->CompleteUpgrade(stickyConn,
                                                      mUpgradeProtocolCallback);
         }
     }
 
-    mIsPending = false;
-
     // if needed, check cache entry has all data we expect
     if (mCacheEntry && mCachePump &&
         mConcurentCacheAccess && contentComplete) {
         int64_t size, contentLength;
         nsresult rv = CheckPartial(mCacheEntry, &size, &contentLength);
         if (NS_SUCCEEDED(rv)) {
             if (size == int64_t(-1)) {
                 // mayhemer TODO - we have to restart read from cache here at the size offset
@@ -5177,16 +5176,17 @@ nsHttpChannel::OnStopRequest(nsIRequest 
                 }
                 else {
                     LOG(("  but range request setup failed rv=0x%08x, failing load", rv));
                 }
             }
         }
     }
 
+    mIsPending = false;
     mStatus = status;
 
     // perform any final cache operations before we close the cache entry.
     if (mCacheEntry && mRequestTimeInitialized) {
         bool writeAccess;
         // New implementation just returns value of the !mCacheEntryIsReadOnly flag passed in.
         // Old implementation checks on nsICache::ACCESS_WRITE flag.
         mCacheEntry->HasWriteAccess(!mCacheEntryIsReadOnly, &writeAccess);