#49781 [Opn->Fbk]: stream_get_meta_data seeks past http headers
| From: | sjoerd@php.net | Date: | Tue, 06 Oct 2009 11:20:07 +0000 |
| Subject: | #49781 [Opn->Fbk]: stream_get_meta_data seeks past http headers | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-143308@lists.php.net to get a copy of this message | ||
ID: 49781
Updated by: sjoerd@php.net
Reported By: marques at displague dot com
-Status: Open
+Status: Feedback
Bug Type: Streams related
Operating System: linux
PHP Version: 5.2.11
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[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