]> granicus.if.org Git - php/commitdiff
Only wind filters when appending to the read chain.
authorSara Golemon <pollita@php.net>
Thu, 1 Apr 2004 03:52:34 +0000 (03:52 +0000)
committerSara Golemon <pollita@php.net>
Thu, 1 Apr 2004 03:52:34 +0000 (03:52 +0000)
main/streams/filter.c

index 708889f97ce5fed805a3c783c86887bde22bde19..7e6df8663c9bd483aaf885ce0382b284294bc227 100644 (file)
@@ -311,7 +311,7 @@ PHPAPI void php_stream_filter_append(php_stream_filter_chain *chain, php_stream_
        chain->tail = filter;
        filter->chain = chain;
 
-       if ((stream->writepos - stream->readpos) > 0) {
+       if (&(stream->readfilters) == chain && (stream->writepos - stream->readpos) > 0) {
                /* Let's going ahead and wind anything in the buffer through this filter */
                php_stream_bucket_brigade brig_in = { NULL, NULL }, brig_out = { NULL, NULL };
                php_stream_bucket_brigade *brig_inp = &brig_in, *brig_outp = &brig_out;