Permalink
Browse files

Use Buffer.byteLength not process._byteLength

  • Loading branch information...
1 parent aadd6e7 commit 06c4348db7e45955e7c869ffba6e2477d9573472 @fictorial fictorial committed Apr 21, 2010
Showing with 4 additions and 4 deletions.
  1. +2 −2 lib/redis-client.js
  2. +2 −2 test/test.js
View
@@ -759,8 +759,8 @@ Client.prototype.sendCommand = function () {
offset += this.requestBuffer.asciiWrite(CRLF, offset);
} else if (arg.toString) {
var asString = arg.toString();
- var serialized = '$' + process._byteLength(asString) + CRLF + asString + CRLF;
- ensureSpaceFor(process._byteLength(serialized));
+ var serialized = '$' + Buffer.byteLength(asString) + CRLF + asString + CRLF;
+ ensureSpaceFor(Buffer.byteLength(serialized));
offset += this.requestBuffer.utf8Write(serialized, offset);
}
}
View
@@ -1692,7 +1692,7 @@ function testLargeGetSet() {
var fileContents = fs.readFileSync(__filename);
- if (process._byteLength(fileContents) < client.requestBuffer.length)
+ if (Buffer.byteLength(fileContents) < client.requestBuffer.length)
assert.fail("the request buffer will not be forced to grow", "testGET (large; 0)");
client.set('largetestfile', fileContents, function (err, value) {
@@ -1731,7 +1731,7 @@ function testStoreAnImage(callback) {
// You can pass Buffer objects to the client's methods.
- var imageBuffer = new Buffer(process._byteLength(fileContents));
+ var imageBuffer = new Buffer(Buffer.byteLength(fileContents));
imageBuffer.binaryWrite(fileContents, 0);
client.set('png_image', imageBuffer, function (err, value) {

0 comments on commit 06c4348

Please sign in to comment.