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

 ID:                 53006
 Updated by:         cataphr...@php.net
 Reported by:        poulpillusion at free dot fr
 Summary:            stream_get_contents offset max is 1165
-Status:             Assigned
+Status:             Feedback
 Type:               Bug
 Package:            Streams related
 Operating System:   Linux Aptosid
 PHP Version:        5.3.3
 Assigned To:        cataphract
 Block user comment: N

 New Comment:

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




Previous Comments:
------------------------------------------------------------------------
[2010-10-14 05:15:19] cataphr...@php.net

Automatic comment from SVN on behalf of cataphract
Revision: http://svn.php.net/viewvc/?view=revision&revision=304384
Log: - [DOC] Reverted rev #304382 and rev #304380, as I figured out a
way to
  fix the erratic behavior without breaking backwards compatibility.
Namely,
  $offset retains SEEK_SET behavior but actually SEEK_CUR is passed to
  _php_stream_seek, if possible, by moving the offset
stream->position bytes.
- Addresses bug #53006.

------------------------------------------------------------------------
[2010-10-14 04:03:20] cataphr...@php.net

Automatic comment from SVN on behalf of cataphract
Revision: http://svn.php.net/viewvc/?view=revision&revision=304380
Log: - [DOC] Changed stream_get_contents() so that the offset is
relative to the
  current position (seek with SEEK_CUR, not SEEK_SET). Only positive
values are
  allowed. This breaking change is necessary to fix the erratic behavior
in
  streams without a seek handlder. Addresses bug #53006.
#Note that the example on the doc page for stream_get_contents() may
fail
#without this change.
#This change is also in the spirit of stream_get_contents(), whose
description
#is "Reads all remaining bytes (or up to maxlen bytes) from a
stream...".
#Previous behavior allowed setting the file pointer to positions before
the
#current one, so they wouldn't be "remaining bytes". The
previous behavior was
#also inconsistent in that it allowed an moving to offset 1, 2, ..., but
not 0.

------------------------------------------------------------------------
[2010-10-13 23:59:37] poulpillusion at free dot fr

Ok so... is there anything else I can do to help you fix this bug ? I
mean : more testing, more feedback ?

------------------------------------------------------------------------
[2010-10-11 18:44:37] cataphr...@php.net

There's definitely a bug here.



However:



* I couldn't reproduce any long blocking. The erroneous behavior was
simply the (timely) return of an empty string from stream_get_contents.

* In the network traffic dump, I couldn't find a FIN packet. PHP sent a
RST right away.



I tried with Debian Lenny, PHP 5.3.3 (CLI).

------------------------------------------------------------------------
[2010-10-11 17:15:35] cataphr...@php.net

Ah, I didn't realize it was a full wireshark log. Thanks, I'll look into
it.

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


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    http://bugs.php.net/bug.php?id=53006


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

Reply via email to