mike            Thu Apr 20 17:43:18 2006 UTC

  Added files:                 (Branch: PHP_5_1)
    /php-src/ext/standard/tests/filters read.phpt 

  Modified files:              
    /php-src/main/streams       streams.c 
    /php-src    NEWS 
  Log:
  - Fix reading stream filters never notified about EOF
  
  
http://cvs.php.net/viewcvs.cgi/php-src/main/streams/streams.c?r1=1.82.2.4&r2=1.82.2.5&diff_format=u
Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.82.2.4 
php-src/main/streams/streams.c:1.82.2.5
--- php-src/main/streams/streams.c:1.82.2.4     Sun Jan  1 12:50:18 2006
+++ php-src/main/streams/streams.c      Thu Apr 20 17:43:18 2006
@@ -19,7 +19,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: streams.c,v 1.82.2.4 2006/01/01 12:50:18 sniper Exp $ */
+/* $Id: streams.c,v 1.82.2.5 2006/04/20 17:43:18 mike Exp $ */
 
 #define _GNU_SOURCE
 #include "php.h"
@@ -433,7 +433,7 @@
                /* allocate a buffer for reading chunks */
                chunk_buf = emalloc(stream->chunk_size);
 
-               while (!err_flag && (stream->writepos - stream->readpos < 
(off_t)size)) {
+               while (!stream->eof && !err_flag && (stream->writepos - 
stream->readpos < (off_t)size)) {
                        size_t justread = 0;
                        int flags;
                        php_stream_bucket *bucket;
@@ -442,7 +442,7 @@
 
                        /* read a chunk into a bucket */
                        justread = stream->ops->read(stream, chunk_buf, 
stream->chunk_size TSRMLS_CC);
-                       if (justread != (size_t)-1) {
+                       if (justread && justread != (size_t)-1) {
                                bucket = php_stream_bucket_new(stream, 
chunk_buf, justread, 0, 0 TSRMLS_CC);
 
                                /* after this call, bucket is owned by the 
brigade */
http://cvs.php.net/viewcvs.cgi/php-src/NEWS?r1=1.2027.2.522&r2=1.2027.2.523&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.522 php-src/NEWS:1.2027.2.523
--- php-src/NEWS:1.2027.2.522   Thu Apr 20 07:30:37 2006
+++ php-src/NEWS        Thu Apr 20 17:43:18 2006
@@ -1,6 +1,7 @@
 PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? Apr 2006, PHP 5.1.3
+- Fixed reading stream filters never notified about EOF. (Mike)
 - Fixed bug #37138 (__autoload tries to load callback'ed self and parent).
   (Dmitry)
 - Fixed bug #37103 (libmbfl headers not installed). (Jani)

http://cvs.php.net/viewcvs.cgi/php-src/ext/standard/tests/filters/read.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/filters/read.phpt
+++ php-src/ext/standard/tests/filters/read.phpt


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

Reply via email to