Bug 715198 - disable cache compression (avoid failures when new profile accessed by old software versions); r=bjarne
authorGeoff Brown <gbrown@mozilla.com>
Tue, 17 Jan 2012 12:51:17 +0100
changeset 85894 b41beba4c7bb78da9a7d1529ff81b778a03f8ded
parent 85893 b3435ec4db1d4c1d8beef39b590230d995b1936c
child 85895 2613bbdae8c6142f0e47c842bc80885fed47ea77
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbjarne
bugs715198
milestone12.0a1
Bug 715198 - disable cache compression (avoid failures when new profile accessed by old software versions); r=bjarne
mobile/android/app/mobile.js
mobile/xul/app/mobile.js
modules/libpref/src/init/all.js
netwerk/cache/nsCacheEntryDescriptor.cpp
--- a/mobile/android/app/mobile.js
+++ b/mobile/android/app/mobile.js
@@ -103,16 +103,19 @@ pref("image.cache.size", 1048576); // by
 
 /* offline cache prefs */
 pref("browser.offline-apps.notify", true);
 pref("browser.cache.offline.enable", true);
 pref("browser.cache.offline.capacity", 5120); // kilobytes
 pref("offline-apps.quota.max", 2048); // kilobytes
 pref("offline-apps.quota.warn", 1024); // kilobytes
 
+// cache compression turned off for now - see bug #715198
+pref("browser.cache.compression_level", 0);
+
 /* protocol warning prefs */
 pref("network.protocol-handler.warn-external.tel", false);
 pref("network.protocol-handler.warn-external.mailto", false);
 pref("network.protocol-handler.warn-external.vnd.youtube", false);
 
 /* http prefs */
 pref("network.http.pipelining", true);
 pref("network.http.pipelining.ssl", true);
--- a/mobile/xul/app/mobile.js
+++ b/mobile/xul/app/mobile.js
@@ -101,18 +101,18 @@ pref("image.cache.size", 1048576); // by
 
 /* offline cache prefs */
 pref("browser.offline-apps.notify", true);
 pref("browser.cache.offline.enable", true);
 pref("browser.cache.offline.capacity", 5120); // kilobytes
 pref("offline-apps.quota.max", 2048); // kilobytes
 pref("offline-apps.quota.warn", 1024); // kilobytes
 
-/* zlib compression level used for cache compression */
-pref("browser.cache.compression_level", 1);
+// cache compression turned off for now - see bug #715198
+pref("browser.cache.compression_level", 0);
 
 /* protocol warning prefs */
 pref("network.protocol-handler.warn-external.tel", false);
 pref("network.protocol-handler.warn-external.mailto", false);
 pref("network.protocol-handler.warn-external.vnd.youtube", false);
 
 /* http prefs */
 pref("network.http.pipelining", true);
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -91,17 +91,18 @@ pref("offline-apps.quota.max",        20
 // the user should be warned if offline app disk usage exceeds this amount
 // (in kilobytes)
 pref("offline-apps.quota.warn",        51200);
 
 // zlib compression level used for cache compression:
 // 0 => disable compression
 // 1 => best speed
 // 9 => best compression
-pref("browser.cache.compression_level", 5);
+// cache compression turned off for now - see bug #715198
+pref("browser.cache.compression_level", 0);
 
 // Whether or not indexedDB is enabled.
 pref("dom.indexedDB.enabled", true);
 // Space to allow indexedDB databases before prompting (in MB).
 pref("dom.indexedDB.warningQuota", 50);
 
 // Whether or not Web Workers are enabled.
 pref("dom.workers.enabled", true);
--- a/netwerk/cache/nsCacheEntryDescriptor.cpp
+++ b/netwerk/cache/nsCacheEntryDescriptor.cpp
@@ -328,16 +328,20 @@ nsCacheEntryDescriptor::OpenOutputStream
 
     nsOutputStreamWrapper* cacheOutput = nsnull;
     PRInt32 compressionLevel = nsCacheService::CacheCompressionLevel();
     const char *val;
     val = mCacheEntry->GetMetaDataElement("uncompressed-len");
     if ((compressionLevel > 0) && val) {
         cacheOutput = new nsCompressOutputStreamWrapper(this, offset);
     } else {
+        // clear compression flag when compression disabled - see bug #715198
+        if (val) {
+            mCacheEntry->SetMetaDataElement("uncompressed-len", nsnull);
+        }
         cacheOutput = new nsOutputStreamWrapper(this, offset);
     }
     if (!cacheOutput) return NS_ERROR_OUT_OF_MEMORY;
 
     NS_ADDREF(*result = cacheOutput);
     return NS_OK;
 }