mirror of
https://github.com/predis/predis.git
synced 2026-08-30 04:02:22 +00:00
Check if socket is resource before reading (#802)
This commit is contained in:
@@ -304,7 +304,7 @@ class StreamConnection extends AbstractConnection
|
||||
$bytesLeft = ($size += 2);
|
||||
|
||||
do {
|
||||
$chunk = fread($socket, min($bytesLeft, 4096));
|
||||
$chunk = is_resource($socket) ? fread($socket, min($bytesLeft, 4096)) : false;
|
||||
|
||||
if ($chunk === false || $chunk === '') {
|
||||
$this->onConnectionError('Error while reading bytes from the server.');
|
||||
|
||||
Reference in New Issue
Block a user