summaryrefslogtreecommitdiff
path: root/main/streams/streams.c
diff options
context:
space:
mode:
authorKonstantin Kopachev <tenzzor@gmail.com>2018-09-17 21:44:01 -0700
committerJoe Watkins <krakjoe@php.net>2019-10-03 06:50:43 +0200
commit05560b67bc87a2bcbfd5b48a48443a62f3311e7d (patch)
treeeda0a78887a15d6a8e6c6852ea0d6d7572f8430c /main/streams/streams.c
parentf2fb37a772908a9331e67f583fddcc4b1b186ccf (diff)
downloadphp-git-05560b67bc87a2bcbfd5b48a48443a62f3311e7d.tar.gz
Fix #76859 stream_get_line skips data if used with data-generating filter
stream_get-line repeatedly calls php_stream_fill_read_buffer until enough data is accumulated in buffer. However, when stream contains filters attached to it, then each call to fill buffer essentially resets buffer read/write pointers and new data is written over old. This causes stream_get_line to skip parts of data from stream This patch fixes such behavior, so fill buffer call will append.
Diffstat (limited to 'main/streams/streams.c')
-rw-r--r--main/streams/streams.c4
1 files changed, 0 insertions, 4 deletions
diff --git a/main/streams/streams.c b/main/streams/streams.c
index 399ec29810..b504711db3 100644
--- a/main/streams/streams.c
+++ b/main/streams/streams.c
@@ -531,10 +531,6 @@ PHPAPI void _php_stream_fill_read_buffer(php_stream *stream, size_t size)
php_stream_bucket_brigade brig_in = { NULL, NULL }, brig_out = { NULL, NULL };
php_stream_bucket_brigade *brig_inp = &brig_in, *brig_outp = &brig_out, *brig_swap;
- /* Invalidate the existing cache, otherwise reads can fail, see note in
- main/streams/filter.c::_php_stream_filter_append */
- stream->writepos = stream->readpos = 0;
-
/* allocate a buffer for reading chunks */
chunk_buf = emalloc(stream->chunk_size);