You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
Partial fix for null multi bulk response.
This commit is contained in:
34
index.js
34
index.js
@@ -784,23 +784,25 @@ Multi.prototype.exec = function (callback) {
|
|||||||
|
|
||||||
var i, il, j, jl, reply, args, obj, key, val;
|
var i, il, j, jl, reply, args, obj, key, val;
|
||||||
|
|
||||||
for (i = 1, il = self.queue.length; i < il; i += 1) {
|
if (replies) {
|
||||||
reply = replies[i - 1];
|
for (i = 1, il = self.queue.length; i < il; i += 1) {
|
||||||
args = self.queue[i];
|
reply = replies[i - 1];
|
||||||
|
args = self.queue[i];
|
||||||
// Convert HGETALL reply to object
|
|
||||||
if (reply && args[0].toLowerCase() === "hgetall") {
|
// Convert HGETALL reply to object
|
||||||
obj = {};
|
if (reply && args[0].toLowerCase() === "hgetall") {
|
||||||
for (j = 0, jl = reply.length; j < jl; j += 2) {
|
obj = {};
|
||||||
key = reply[j].toString();
|
for (j = 0, jl = reply.length; j < jl; j += 2) {
|
||||||
val = reply[j + 1];
|
key = reply[j].toString();
|
||||||
obj[key] = val;
|
val = reply[j + 1];
|
||||||
|
obj[key] = val;
|
||||||
|
}
|
||||||
|
replies[i - 1] = reply = obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof args[args.length - 1] === "function") {
|
||||||
|
args[args.length - 1](null, reply);
|
||||||
}
|
}
|
||||||
replies[i - 1] = reply = obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (typeof args[args.length - 1] === "function") {
|
|
||||||
args[args.length - 1](null, reply);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
12
test.js
12
test.js
@@ -204,6 +204,18 @@ tests.MULTI_6 = function () {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
tests.WATCH_MULTI = function () {
|
||||||
|
var name = 'WATCH_MULTI';
|
||||||
|
|
||||||
|
client.watch(name);
|
||||||
|
var multi = client.multi();
|
||||||
|
multi.incr(name);
|
||||||
|
client.incr(name);
|
||||||
|
multi.exec(function (err, replies) {
|
||||||
|
next(name);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
tests.HSET = function () {
|
tests.HSET = function () {
|
||||||
var key = "test hash",
|
var key = "test hash",
|
||||||
field1 = new Buffer("0123456789"),
|
field1 = new Buffer("0123456789"),
|
||||||
|
Reference in New Issue
Block a user