? boost-623784.patch
Index: boost.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/boost/boost.module,v
retrieving revision 1.3.2.2.2.5.2.241
diff -u -p -r1.3.2.2.2.5.2.241 boost.module
--- boost.module	9 Nov 2009 10:47:13 -0000	1.3.2.2.2.5.2.241
+++ boost.module	9 Nov 2009 22:42:04 -0000
@@ -2023,9 +2023,16 @@ function hook_boost_preprocess($path, $d
  *   File extension for this mime type
  */
 function boost_cache_set($path, $data, $extension = BOOST_FILE_EXTENSION) {
+  // Exit if nothing is here to cache
   if (empty($data)) {
     return FALSE;
   }
+
+  // If Compressed data was given to us decompress it
+  if (boost_headers_contain('gzip')) {
+    $data = gzinflate(substr(substr($data, 10), 0, -8));
+  }
+
   $cached_at = date('Y-m-d H:i:s', BOOST_TIME);
   // Code commenting style based on what is being cached.
   // Append the Boost footer with the relevant timestamps
@@ -2081,13 +2088,13 @@ function boost_cache_set($path, $data, $
     // Special handling of the front page for aggressive gzip test
     if ($path == '' && BOOST_AGGRESSIVE_GZIP && $extension == BOOST_FILE_EXTENSION) {
       _boost_generate_gzip_test_file();
-      boost_cache_write($filename, _boost_inject_code($data, '<iframe src="/boost-gzip-cookie-test.html" style="width:0px; height:0px; border:0px; position:absolute; top:-1000px; z-index:10;"></iframe>' . "\n"), 0);
+      boost_cache_write($filename, _boost_inject_code($data, '<iframe src="/boost-gzip-cookie-test.html" style="width:0px; height:0px; border:0px; position:absolute; top:-1000px; z-index:10;"></iframe>' . "\n"), FALSE);
     }
     else {
-      boost_cache_write($filename, $data, 0);
+      boost_cache_write($filename, $data, FALSE);
     }
     if (BOOST_GZIP) {
-      boost_cache_write(str_replace(BOOST_FILE_PATH, BOOST_GZIP_FILE_PATH, $filename) . BOOST_GZIP_EXTENSION, $data, 1);
+      boost_cache_write(str_replace(BOOST_FILE_PATH, BOOST_GZIP_FILE_PATH, $filename) . BOOST_GZIP_EXTENSION, $data, TRUE);
     }
     if (!BOOST_NO_DATABASE) {
       boost_db_prep($filename, $extension, BOOST_TIME + $expire);
@@ -2563,19 +2570,9 @@ function boost_get_time($table, $column)
  *   Contents of file
  * @param $gzip
  *   Should the contents be gzipped?
- *   0 = No
- *   1 = Yes
- *   2 = Yes & decompress & recompress
  */
 function boost_cache_write($filename, $data, $gzip) {
-  if (boost_headers_contain('gzip') && $gzip == 0) {
-    $data = gzinflate(substr(substr($data, 10), 0, -8));
-  }
-  if (!boost_headers_contain('gzip') && $gzip == 1) {
-    $data = gzencode($data, 9);
-  }
-  if (boost_headers_contain('gzip') && $gzip == 2) {
-    $data = gzinflate(substr(substr($data, 10), 0, -8));
+  if ($gzip) {
     $data = gzencode($data, 9);
   }
   if (!_boost_mkdir_p(dirname($filename))) {
