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] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!