ID:               49781
 User updated by:  marques at displague dot com
 Reported By:      marques at displague dot com
-Status:           Feedback
+Status:           Open
 Bug Type:         Streams related
 Operating System: linux
 PHP Version:      5.2.11
 New Comment:

I missed this in stream_filter_prepend(), which explains the problem:

Note: Stream data is read from resources (both local and remote) in 
chunks, with any unconsumed data kept in internal buffers. When a new 
filter is prepended to a stream, data in the internal buffers, which 
has already been processed through other filters will not be 
reprocessed through the new filter at that time. This differs from the

behavior of stream_filter_append().

This behavior and the non-existence of a stream_filter_unregister() 
function, means that I can't code a replacement for the bad dechunker 
in PHP 5.3.0.


Previous Comments:
------------------------------------------------------------------------

[2009-10-06 11:20:07] [email protected]

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.



------------------------------------------------------------------------

[2009-10-05 19:59:08] marques at displague dot com

Description:
------------
stream_get_meta_data will set the seek pointer in the buffer to some 
point past the headers.  The result is that if you want to use 
stream_filter_prepend or stream_filter_append (after examining the meta

data) your first bucket will contain data after the meta data (HTTP 
headers) and some of the initial content.

While trying to implement a chunked stream filter for PHP < 5.3.1 I 
experienced this.  The first bucket begins just after the hex chunklen

of the second chunk.  Switching to an fgets() loop on the headers (and

stopping at the first empty line)  corrects this.



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=49781&edit=1

Reply via email to