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

Bug #1429 readFromSocket fails on \'0\'
Submitted: 2004-05-18 07:51 UTC
From: rick at gibbed dot us Assigned: schst
Status: Closed Package: Net_Server
PHP Version: 4.3.6 OS: Linux
Roadmaps: (Not assigned)    
Comments Add Comment Add patch

Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem : 39 + 27 = ?

 [2004-05-18 07:51 UTC] rick at gibbed dot us
Description: ------------ If '0' (by itself?) is sent to the Net_Server server, the client will be dropped as if the client had sent an empty data package, this is due to an improper checking of the data that socket_read returns in Driver.php. It also fails in Driver/Sequential.php when checking for an empty data package. Fixes are provided. The fix for Driver/Fork.php is untested. Reproduce code: --------------- (affected line ~172 in Driver.php) while($buf = socket_read($this->clientFD[$clientId], $this->readBufferSize)) { (fixed version) while(($buf = socket_read($this->clientFD[$clientId], $this->readBufferSize, PHP_BINARY_READ)) !== false) { (affected line ~155 in Driver/Sequential.php) if (!$data) { (fixed version) if (trim($data) == "") { (affected line ~175) if (!$data) { (fixed version) if (trim($data) == "") { Expected result: ---------------- Not to close the connection on me ;-) Actual result: -------------- Closes connection. "Connection closed by peer."


 [2004-05-18 07:52 UTC] rick at gibbed dot us
(affected line ~175) should be (affected line ~175 in Driver/Fork.php)
 [2004-07-02 17:24 UTC] schst
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at