Skip to content

Commit

Permalink
[stream] Don't emit data if empty. Replaced py test with php
Browse files Browse the repository at this point in the history
  • Loading branch information
cboden committed Apr 13, 2014
1 parent b2f58f2 commit 43b9343
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ public function handleData($stream)
// Socket is raw, not using fread as it's interceptable by filters
// See issues #192, #209, and #240
$data = stream_socket_recvfrom($stream, $this->bufferSize);
if( '' !== $data || false !== $data ){
if ('' !== $data && false !== $data) {
$this->emit('data', array($data, $this));
}

if ('' === $data || false === $data || feof($stream)) {
$this->end();
}
Expand Down

0 comments on commit 43b9343

Please sign in to comment.