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

Bug #6789 Net_Sock::eof() returns false when socket is already disconnected
Submitted: 2006-02-15 10:21 UTC
From: satanistlav at mail dot ru Assigned: cweiske
Status: Closed Package: Net_Socket (version 1.0.6)
PHP Version: 5.0.5 OS: Win XP
Roadmaps: (Not assigned)    
Subscription  


 [2006-02-15 10:21 UTC] satanistlav at mail dot ru
Description: ------------ Net_Sock::eof() returns false when socket is already disconnected in HTTP_Request class line 1040 Test script: --------------- class myListener extends HTTP_Request_Listener{ function update(&$subject, $event, $data = null){ if ($event == 'gotHeaders'){ $subject->_sock->disconnect(); //should disconnect after recieving headers but it wil l not }elseif($event == 'gotBody'){ echo $data; } } } $request = new HTTP_Request('http://www.php.net/'); $request->attach(new myListener()); $request->sendRequest(); Expected result: ---------------- It should stop and should not download the the page body Actual result: -------------- FATAL: erealloc(): Unable to allocate nnnnnn bytes.

Comments

 [2006-02-15 10:30 UTC] satanistlav at mail dot ru
it works fine when I change the code as below function eof() { if (!is_resource($this->fp)) { return true; } return feof($this->fp); }
 [2006-12-13 21:10 UTC] cweiske (Christian Weiske)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net 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.