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

Fix for [GH-127]

Re-initialize the reply parser for every new connection.  If a connection is terminated,
the parser could be left in a bad state.  After the auto-reconnect magic kicks in, it
tries to reuse the old parser, which will not work.

This change is visible to client programs if you depend on client.reply_parser.name being
set immediately.  It will now only be set after a connection is established.

Thanks to @jhurliman for reporting and @pietern for the fix suggestion.
This commit is contained in:
Matt Ranney
2011-08-11 11:00:02 -07:00
parent 688b838be7
commit 3e95c55a03
4 changed files with 60 additions and 43 deletions

View File

@@ -1194,10 +1194,9 @@ run_next_test = function run_next_test() {
}
};
console.log("Using reply parser " + client.reply_parser.name);
client.once("ready", function start_tests() {
console.log("Connected to " + client.host + ":" + client.port + ", Redis server version " + client.server_info.redis_version + "\n");
console.log("Using reply parser " + client.reply_parser.name);
run_next_test();