Bug #53006 [Asn]: stream_get_contents offset max is 1165

From: Date: Wed, 13 Oct 2010 21:59:37 +0000
Subject: Bug #53006 [Asn]: stream_get_contents offset max is 1165
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-155153@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53006&edit=1

 ID:                 53006
 User updated by:    poulpillusion at free dot fr
 Reported by:        poulpillusion at free dot fr
 Summary:            stream_get_contents offset max is 1165
 Status:             Assigned
 Type:               Bug
 Package:            Streams related
 Operating System:   Linux Aptosid
 PHP Version:        5.3.3
 Assigned To:        cataphract
 Block user comment: N

 New Comment:

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


Previous Comments:
------------------------------------------------------------------------
[2010-10-11 18:44:37] cataphract@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] cataphract@php.net

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

------------------------------------------------------------------------
[2010-10-09 01:33:04] poulpillusion at free dot fr

Well in fact I realized something strange... 

It sometimes works here. But most of the time it does not. I hit Ctrl+F5
to refresh and in about 10% cases I get the data... but in 90% cases it
simply outputs nothing.

It seems to depend on the file I am trying to get : 
- the limit is 1165 for http://www.nocturne-jdr.fr/toto.txt
- the limit is 1189 for
http://peach.themazzone.com/durian/movies/sintel-1024-surround.mp4

Maybe these limits are not the ones you experience... maybe you should
try raising them ?

Concerning wireshark, it's not a tool I am really used to... Did my dump
help you anyway ? You can open it with wireshark to examine it... But if
it does not help, maybe you coult send me a link to some
tutorial/documentation ?

Thank you.

------------------------------------------------------------------------
[2010-10-08 02:29:36] cataphract@php.net

Your script works here. Outputs:

«9
320
32»

As to the wireshark log, what I need is not the data of the
conversation, it's the packets that came and their size. Only that can
shed light on this problem.

------------------------------------------------------------------------
[2010-10-08 00:31:33] poulpillusion at free dot fr

Here is a sample code you can paste into a PHP file :

<?php
// this does not work : 1166 seems to big... try with 1165 and it will
work !
$url = 'http://www.nocturne-jdr.fr/toto.txt';
$handle = fopen($url, 'rb');
echo stream_get_contents($handle, 8, 1166);
?>

I dumped the conversation with wireshark but I don't know which parts
are the "relevant" ones... Here it is :
http://www.nocturne-jdr.fr/capture.log

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


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


Thread (12 messages)

« previous php.bugs (#155153) next »