You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
Now it works with SlowBuffer too.
This commit is contained in:
6
index.js
6
index.js
@@ -546,7 +546,7 @@ RedisClient.prototype.send_command = function (command, args, callback) {
|
|||||||
command_str = "*" + elem_count + "\r\n$" + command.length + "\r\n" + command + "\r\n";
|
command_str = "*" + elem_count + "\r\n$" + command.length + "\r\n" + command + "\r\n";
|
||||||
|
|
||||||
for (i = 0, il = args.length, arg; i < il; i += 1) {
|
for (i = 0, il = args.length, arg; i < il; i += 1) {
|
||||||
if (args[i] instanceof Buffer) {
|
if (Buffer.isBuffer(args[i])) {
|
||||||
buffer_args = true;
|
buffer_args = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -571,11 +571,11 @@ RedisClient.prototype.send_command = function (command, args, callback) {
|
|||||||
|
|
||||||
for (i = 0, il = args.length, arg; i < il; i += 1) {
|
for (i = 0, il = args.length, arg; i < il; i += 1) {
|
||||||
arg = args[i];
|
arg = args[i];
|
||||||
if (!(arg instanceof Buffer || arg instanceof String)) {
|
if (!(Buffer.isBuffer(arg) || arg instanceof String)) {
|
||||||
arg = String(arg);
|
arg = String(arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (arg instanceof Buffer) {
|
if (Buffer.isBuffer(arg)) {
|
||||||
if (arg.length === 0) {
|
if (arg.length === 0) {
|
||||||
if (exports.debug_mode) {
|
if (exports.debug_mode) {
|
||||||
console.log("send_command: using empty string for 0 length buffer");
|
console.log("send_command: using empty string for 0 length buffer");
|
||||||
|
Reference in New Issue
Block a user