Bug 979422 - HTTP old cache wrapper performs UMR if onCacheEntryCheck fails, r=michal
authorHonza Bambas <honzab.moz@firemni.cz>
Mon, 17 Mar 2014 18:21:39 +0100
changeset 173952 042679e999a7baeb24c03ed4d9760ef7fccf4c74
parent 173951 08d252ee432ad51a00fd6a419db107dd711dc4d6
child 173953 c9f1ddebc4041bd50da8f0f1f4766d6394d4a0f8
push id26438
push userphilringnalda@gmail.com
push dateTue, 18 Mar 2014 05:39:07 +0000
treeherderautoland@89275f0ae29f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmichal
bugs979422
milestone30.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 979422 - HTTP old cache wrapper performs UMR if onCacheEntryCheck fails, r=michal
netwerk/cache2/OldWrappers.cpp
--- a/netwerk/cache2/OldWrappers.cpp
+++ b/netwerk/cache2/OldWrappers.cpp
@@ -691,17 +691,17 @@ void
   nsresult rv = mCallback->OnCacheEntryCheck(mCacheEntry, mAppCache, &result);
   LOG(("  OnCacheEntryCheck result ent=%p, cb=%p, appcache=%p, rv=0x%08x, result=%d",
     mCacheEntry.get(), mCallback.get(), mAppCache.get(), rv, result));
 
   if (NS_FAILED(rv)) {
     NS_WARNING("cache check failed");
   }
 
-  if (result == nsICacheEntryOpenCallback::ENTRY_NOT_WANTED) {
+  if (NS_FAILED(rv) || result == nsICacheEntryOpenCallback::ENTRY_NOT_WANTED) {
     mCacheEntry->Close();
     mCacheEntry = nullptr;
     mStatus = NS_ERROR_CACHE_KEY_NOT_FOUND;
   }
 }
 
 NS_IMETHODIMP
 _OldCacheLoad::OnCacheEntryDoomed(nsresult)