Permalink
Browse files

Fixed bug with buffer.slice() and large request data

  • Loading branch information...
1 parent 9c5ea3c commit 9bdf4eaf904de1dd59c096c58a16bb884c85e32f @tautologistics committed with fictorial Apr 30, 2010
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/redis-client.js
View
4 lib/redis-client.js
@@ -743,7 +743,9 @@ Client.prototype.sendCommand = function () {
if (this.stream.writable) {
this.originalCommands.push(originalCommand);
- this.stream.write(this.requestBuffer.slice(0, offset), 'binary');
+ var outBuffer = new Buffer(offset);
+ this.requestBuffer.copy(outBuffer, 0, 0, offset);
+ this.stream.write(outBuffer, 'binary');
if (exports.debugMode)
sys.debug("[SEND] " + debugFilter(this.requestBuffer, offset) +

0 comments on commit 9bdf4ea

Please sign in to comment.