Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.4.4

Bug #14200 Reading of chunked responses stops early
Submitted: 2008-06-20 08:15 UTC
From: mrbig Assigned: avb
Status: Closed Package: HTTP_Request (version 1.4.2)
PHP Version: 5.2.3 OS: linux
Roadmaps: 1.4.3    

 [2008-06-20 08:15 UTC] mrbig (Attila Nagy)
Description: ------------ When reading chunked messages without any Content-length header reading occosionally stops before recieving the complete response. As I digged through the Request.php I've noticed, that reading stops in the following cases: - eof on the socket - nothing left to read - no data received The latter case is problematic: when the client is faster than the server, then reading the first chunk may returns before the requested amount of bytes is read, since there is nothing in the pipe at that time. Then the loop goes around, and the package tries to read again, at what time might there is any new data or might there isn't. In the latter case reading will stop without waiting for the connection actually getting to be closed. I've attached a patch, that changes this exit point, and if there is any more chunk to be read, and the connection is not closed yet, then it won't exit.


 [2008-06-23 22:12 UTC] avb (Alexey Borzov)
The patch doesn't look like it'll break anything, so will probably apply it.
 [2008-07-21 16:42 UTC] avb (Alexey Borzov)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. -- Patch applied, thanks!