]> granicus.if.org Git - php/commitdiff
MFH: RIP: Greedy read problems
authorWez Furlong <wez@php.net>
Sat, 10 Jul 2004 10:54:27 +0000 (10:54 +0000)
committerWez Furlong <wez@php.net>
Sat, 10 Jul 2004 10:54:27 +0000 (10:54 +0000)
main/streams.c

index b5e7be49f823533e2ac7f8a561b0bbfdc183745e..4a1be60af44419b38a8f5de3b10360c8075bc3b4 100755 (executable)
@@ -55,6 +55,8 @@
 
 #define PHP_STDIOP_GET_FD(anfd, data)   anfd = (data)->file ? fileno((data)->file) : (data)->fd
 
+static php_stream_wrapper php_plain_files_wrapper;
+
 /* {{{ some macros to help track leaks */
 #if ZEND_DEBUG
 #define emalloc_rel_orig(size) \
@@ -648,7 +650,8 @@ PHPAPI size_t _php_stream_read(php_stream *stream, char *buf, size_t size TSRMLS
                }
 
                /* just break anyway, to avoid greedy read */
-               break;
+               if (stream->wrapper != &php_plain_files_wrapper)
+                       break;
        }
 
        if (didread > 0)