Fixing bug in Redisent causing Resque to ignore queue items larger than 1Kb.

This commit is contained in:
KevBurnsJr 2010-11-08 11:35:33 -08:00
parent 5fb34c3a90
commit 5fcd195db1

View File

@ -83,15 +83,15 @@ class Redisent {
break; break;
/* Bulk reply */ /* Bulk reply */
case '$': case '$':
$response = null;
if ($reply == '$-1') { if ($reply == '$-1') {
$response = null;
break; break;
} }
$read = 0; $read = 0;
$size = substr($reply, 1); $size = substr($reply, 1);
do { do {
$block_size = ($size - $read) > 1024 ? 1024 : ($size - $read); $block_size = ($size - $read) > 1024 ? 1024 : ($size - $read);
$response = fread($this->__sock, $block_size); $response .= fread($this->__sock, $block_size);
$read += $block_size; $read += $block_size;
} while ($read < $size); } while ($read < $size);
fread($this->__sock, 2); /* discard crlf */ fread($this->__sock, 2); /* discard crlf */