1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00

In nested MULTIBULK buffers, correctly recurse on an incomplete read buffer.

Signed-off-by: DTrejo <david.daniel.trejo@gmail.com>
This commit is contained in:
Bryce Baril
2013-02-23 21:15:11 -08:00
committed by DTrejo
parent 9127f34393
commit 92ed0befc1
2 changed files with 34 additions and 5 deletions

View File

@@ -117,15 +117,15 @@ ReplyParser.prototype._parseResult = function (type) {
offset = this._offset;
packetHeader = new Packet(type, this.parseHeader());
if (packetHeader.size > this._bytesRemaining()) {
this._offset = offset - 1;
return -1;
}
if (packetHeader.size < 0) {
return null;
}
if (packetHeader.size > this._bytesRemaining()) {
this._offset = offset - 1;
throw new IncompleteReadBuffer("Wait for more data.");
}
var reply = [ ];
var ntype, i, res;