cellog          Sat Jan 12 22:03:32 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/zlib   zlib_filter.c 
    /php-src/ext/bz2    bz2_filter.c 
  Log:
  far better fix for bug #40189
  
http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/zlib_filter.c?r1=1.6.2.2.2.4.2.5&r2=1.6.2.2.2.4.2.6&diff_format=u
Index: php-src/ext/zlib/zlib_filter.c
diff -u php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.4.2.5 
php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.4.2.6
--- php-src/ext/zlib/zlib_filter.c:1.6.2.2.2.4.2.5      Sat Jan 12 21:28:47 2008
+++ php-src/ext/zlib/zlib_filter.c      Sat Jan 12 22:03:32 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zlib_filter.c,v 1.6.2.2.2.4.2.5 2008/01/12 21:28:47 cellog Exp $ */
+/* $Id: zlib_filter.c,v 1.6.2.2.2.4.2.6 2008/01/12 22:03:32 cellog Exp $ */
 
 #include "php.h"
 #include "php_zlib.h"
@@ -100,7 +100,7 @@
                        consumed += desired;
                        bin += desired;
 
-                       if (status == Z_STREAM_END || data->strm.avail_out < 
data->outbuf_len) {
+                       if (data->strm.avail_out < data->outbuf_len) {
                                php_stream_bucket *out_bucket;
                                size_t bucketlen = data->outbuf_len - 
data->strm.avail_out;
                                out_bucket = php_stream_bucket_new(stream, 
estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
@@ -108,13 +108,10 @@
                                data->strm.avail_out = data->outbuf_len;
                                data->strm.next_out = data->outbuf;
                                exit_status = PSFS_PASS_ON;
-                               if (status == Z_STREAM_END) {
-                                       /* no more data to decompress, and 
nothing was spat out */
-                                       if (data->strm.avail_out >= 
data->outbuf_len) {
-                                               php_stream_bucket_delref(bucket 
TSRMLS_CC);
-                                       }
-                                       return PSFS_PASS_ON;
-                               }
+                       } else if (status == Z_STREAM_END && 
data->strm.avail_out >= data->outbuf_len) {
+                               /* no more data to decompress, and nothing was 
spat out */
+                               php_stream_bucket_delref(bucket TSRMLS_CC);
+                               return PSFS_PASS_ON;
                        }
                }
                php_stream_bucket_delref(bucket TSRMLS_CC);
http://cvs.php.net/viewvc.cgi/php-src/ext/bz2/bz2_filter.c?r1=1.3.2.2.2.5.2.3&r2=1.3.2.2.2.5.2.4&diff_format=u
Index: php-src/ext/bz2/bz2_filter.c
diff -u php-src/ext/bz2/bz2_filter.c:1.3.2.2.2.5.2.3 
php-src/ext/bz2/bz2_filter.c:1.3.2.2.2.5.2.4
--- php-src/ext/bz2/bz2_filter.c:1.3.2.2.2.5.2.3        Sat Jan 12 21:28:48 2008
+++ php-src/ext/bz2/bz2_filter.c        Sat Jan 12 22:03:32 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: bz2_filter.c,v 1.3.2.2.2.5.2.3 2008/01/12 21:28:48 cellog Exp $ */
+/* $Id: bz2_filter.c,v 1.3.2.2.2.5.2.4 2008/01/12 22:03:32 cellog Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -101,7 +101,7 @@
                        consumed += desired;
                        bin += desired;
 
-                       if (status == BZ_STREAM_END || data->strm.avail_out < 
data->outbuf_len) {
+                       if (data->strm.avail_out < data->outbuf_len) {
                                php_stream_bucket *out_bucket;
                                size_t bucketlen = data->outbuf_len - 
data->strm.avail_out;
                                out_bucket = php_stream_bucket_new(stream, 
estrndup(data->outbuf, bucketlen), bucketlen, 1, 0 TSRMLS_CC);
@@ -109,13 +109,10 @@
                                data->strm.avail_out = data->outbuf_len;
                                data->strm.next_out = data->outbuf;
                                exit_status = PSFS_PASS_ON;
-                               if (status == BZ_STREAM_END) {
-                                       /* no more data to decompress, and 
nothing was spat out */
-                                       if (data->strm.avail_out >= 
data->outbuf_len) {
-                                               php_stream_bucket_delref(bucket 
TSRMLS_CC);
-                                       }
-                                       return PSFS_PASS_ON;
-                               }
+                       } else if (status == BZ_STREAM_END && 
data->strm.avail_out >= data->outbuf_len) {
+                               /* no more data to decompress, and nothing was 
spat out */
+                               php_stream_bucket_delref(bucket TSRMLS_CC);
+                               return PSFS_PASS_ON;
                        }
                }
                php_stream_bucket_delref(bucket TSRMLS_CC);

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to