History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: ZF-154
Type: Bug Bug
Status: Resolved Resolved
Resolution: Incomplete
Priority: Minor Minor
Assignee: Shahar Evron
Reporter: Naoto Ishikawa
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Google issue summary
Zend Framework

an invalid response causes an infinite loop

Created: 28/Jun/06 09:24 AM   Updated: 05/Jul/07 02:43 PM
Component/s: Zend_Http_Client
Affects Version/s: None
Fix Version/s: 0.1.5

Time Tracking:
Not Specified

Resolution Date: 01/Jul/06 10:15 AM


 Description  « Hide
At Zend_Http_Response incubator version,
extractBody method is written by following code.

static public function extractBody(&$response_str)

{ $lines = explode("\r\n", $response_str); $line = null; while ($line !== "") $line = array_shift($lines); $body = implode("\r\n", $lines); return $body; }

But, if an invalid response with no blank lines is returned, it causes an inifinite loop.
ex) http://web.sfc.keio.ac.jp/~s01133su/mt/archives/000259.html returns response with no CRLFs

So, please check whether $lines is empty or not in the following loop.

while ($line !== "")
$line = array_shift($lines);



 All   Comments   Work Log   Change History   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Shahar Evron - 01/Jul/06 10:15 AM
Infinite looping is now avoided in revision 771 - please test.

Note that the example server you sent uses juft LF as line breaks, which AFAIK breaks RFC compatibility (HTTP requests and responses should use CRLF as line breaks).

I reported another bug (ZF-183) to fix this, adding support for non-standard LF line breaks in Zend_Http_Response.

Until this "bug" is also fixed, you will probably get an exception from Zend_Http_Response when trying to read from servers that use LF instead of CRLF.