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

Bug #15030 Poblem with readEndCharacters set is null
Submitted: 2008-11-14 16:01 UTC
From: mrsol Assigned:
Status: Duplicate Package: Net_Server (version 1.0.2)
PHP Version: Irrelevant OS: All
Roadmaps: (Not assigned)    
Subscription  


 [2008-11-14 16:01 UTC] mrsol (Oleg Savostin)
Description: ------------ In Driver.php line 260. Wrong code /** * readEndCharacter is set to null => autodetect */ if (strlen($buf) < $this->readBufferSize) { $data .= $buf; break; } The Givenned code works incorrect. Therefore-that length of the buffer can be less only if and when buffer red not from sockets but from _readLeftOver. But if given r from socket, that as a rule length their will is a length of the request and is got eternal cycle, before that as will not occur the breakup of the connect, herewith get lost all given from socket. Brought below code works orderly. /** * readEndCharacter is set to null => autodetect */ $data .= $buf; if(strlen($data)>$this->readBufferSize){ $this->_readLeftOver = substr($data, $this->readBufferSize); $data = substr($data, 0, $this->readBufferSize); } if(strlen($data)==$this->readBufferSize){ break; } Sorry for my language :-)

Comments

 [2008-11-14 16:21 UTC] mrsol (Oleg Savostin)
Correctly from line 259 ------------------ } else { /** * readEndCharacter is set to null => autodetect */ if(strlen($buf)==0){ break; } $data .= $buf; if(strlen($data)>$this->readBufferSize){ $this->_readLeftOver = substr($data, $this->readBufferSize); $data = substr($data, 0, $this->readBufferSize); } if(strlen($data)==$this->readBufferSize){ break; } } ------------------
 [2008-11-17 00:28 UTC] doconnor (Daniel O'Connor)
Thanks for the report, Oleg, I don't suppose you can add in a small test case? IE $foo = new Foo(); $foo->doSomething(); assert($foo->hasDoneSomething() === true);
 [2008-11-17 04:18 UTC] doconnor (Daniel O'Connor)
Dupe of #14968