? boost-6.patch
? boost-632908.patch
Index: boost.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/boost/boost.module,v
retrieving revision 1.3.2.2.2.5.2.248
diff -u -p -r1.3.2.2.2.5.2.248 boost.module
--- boost.module	13 Nov 2009 23:10:07 -0000	1.3.2.2.2.5.2.248
+++ boost.module	14 Nov 2009 20:25:55 -0000
@@ -1251,6 +1251,13 @@ function theme_boost_cache_status($ttl, 
  */
 function _boost_ob_handler() {
   $buffer = ob_get_contents();
+  // If Compressed data was given to us decompress it
+  if (boost_headers_contain('gzip')) {
+    $decompressed_buffer = gzinflate(substr(substr($buffer, 10), 0, -8));
+  }
+  else {
+    $decompressed_buffer = $buffer;
+  }
 
   // Ensure we're in the correct working directory, since some web servers (e.g. Apache) mess this up here.
   chdir(dirname($_SERVER['SCRIPT_FILENAME']));
@@ -1282,7 +1289,7 @@ function _boost_ob_handler() {
   // Check the currently set content type and the HTTP response code. only cache
   // 'text/*' pages that were output with a 200 OK status. If it didn't get a
   // 200 then remove that entry from the cache.
-  if (!empty($buffer)) {
+  if (!empty($decompressed_buffer)) {
     $status = boost_get_http_status();
     $types = boost_get_content_type();
     if (BOOST_VERBOSE >= 7) {
@@ -1294,7 +1301,7 @@ function _boost_ob_handler() {
         if (BOOST_ASYNCHRONOUS_OUTPUT) {
           boost_async_opp($buffer, FALSE, 'text/javascript');
         }
-        boost_cache_set($GLOBALS['_boost_path'], $buffer, BOOST_JSON_EXTENSION);
+        boost_cache_set($GLOBALS['_boost_path'], $decompressed_buffer, BOOST_JSON_EXTENSION);
       }
       elseif ($status == 404 || $status == 403) {
         $filename = boost_file_path($GLOBALS['_boost_path'], TRUE, BOOST_JSON_EXTENSION);
@@ -1305,7 +1312,7 @@ function _boost_ob_handler() {
         if (BOOST_ASYNCHRONOUS_OUTPUT) {
           boost_async_opp($buffer, FALSE, 'text/xml');
         }
-        boost_cache_set($GLOBALS['_boost_path'], $buffer, BOOST_XML_EXTENSION);
+        boost_cache_set($GLOBALS['_boost_path'], $decompressed_buffer, BOOST_XML_EXTENSION);
       }
       elseif ($status == 404 || $status == 403) {
         $filename = boost_file_path($GLOBALS['_boost_path'], TRUE, BOOST_XML_EXTENSION);
@@ -1316,8 +1323,8 @@ function _boost_ob_handler() {
         if (BOOST_ASYNCHRONOUS_OUTPUT) {
           boost_async_opp($buffer, FALSE, 'text/html');
         }
-        boost_cache_set($GLOBALS['_boost_path'], $buffer, BOOST_FILE_EXTENSION);
-        boost_cache_css_js_files($buffer);
+        boost_cache_set($GLOBALS['_boost_path'], $decompressed_buffer, BOOST_FILE_EXTENSION);
+        boost_cache_css_js_files($decompressed_buffer);
       }
       elseif ($status == 404 || $status == 403) {
         // Kill cache entry if it exists
@@ -2067,11 +2074,6 @@ function boost_cache_set($path, $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
