Skip to content

Commit 43b9343

Browse files
committed
[stream] Don't emit data if empty. Replaced py test with php
1 parent b2f58f2 commit 43b9343

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Connection.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ public function handleData($stream)
1111
// Socket is raw, not using fread as it's interceptable by filters
1212
// See issues #192, #209, and #240
1313
$data = stream_socket_recvfrom($stream, $this->bufferSize);
14-
if( '' !== $data || false !== $data ){
14+
if ('' !== $data && false !== $data) {
1515
$this->emit('data', array($data, $this));
1616
}
17+
1718
if ('' === $data || false === $data || feof($stream)) {
1819
$this->end();
1920
}

0 commit comments

Comments
 (0)