PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Networking » Net_Socket » Bug #5980

readLine hangs

Details

Request #5980readLine hangs
Submitted2005-11-16 10:50 UTC
Frominfo at e-novative dot de
StatusBogus
PackageNet_Socket
PHP Version5.0.5
OSWin XP
Roadmaps(Not assigned)

Comments

[2005-11-16 10:50 UTC] info at e-novative dot de

Description:
------------
I am having trouble with hanging POST requests through HTTP_Client. Seems that no data is coming back from the socket. While debugging, I stumbled across some strange code in the readLine method.

According to the documentation in line 67 $this->timeout is an integer, though it is inizialized to false (?!).

Line 445 says:

$timeout = time() + $this->timeout;
while (!feof($this->fp) && (!$this->timeout || time() < $timeout)) {

As far as I understand, you treat $this->timeout as an integer in the first line. But in the second line you treat it like a boolean. Seems like you are mixing two concepts, a "timeout yes/no" flag and a timeout counter here. IMHO these two should be separated so that the code is more understandable.