Home » Networking » Net_Socket » Bug #5980
readLine hangs
Details
| Request #5980 | readLine hangs |
|---|---|
| Submitted | 2005-11-16 10:50 UTC |
| From | info at e-novative dot de |
| Status | Bogus |
| Package | Net_Socket |
| PHP Version | 5.0.5 |
| OS | Win 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.