From d5bd45a368ca6bc2888d9c28a4d1d61ebfcad771 Mon Sep 17 00:00:00 2001 From: antirez Date: Tue, 22 Oct 2019 12:48:07 +0200 Subject: [PATCH] Modules hooks: fix sub event in calls from client change. --- src/networking.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/networking.c b/src/networking.c index c20c13e9a..dec49642f 100644 --- a/src/networking.c +++ b/src/networking.c @@ -828,7 +828,7 @@ void clientAcceptHandler(connection *conn) { server.stat_numconnections++; moduleFireServerEvent(REDISMODULE_EVENT_CLIENT_CHANGE, - REDISMODULE_SUBEVENT_CLIENT_CHANGE_DISCONNECTED, + REDISMODULE_SUBEVENT_CLIENT_CHANGE_CONNECTED, c); } @@ -1043,6 +1043,9 @@ void freeClient(client *c) { freeClientAsync(c); return; } + moduleFireServerEvent(REDISMODULE_EVENT_CLIENT_CHANGE, + REDISMODULE_SUBEVENT_CLIENT_CHANGE_DISCONNECTED, + c); /* If it is our master that's beging disconnected we should make sure * to cache the state to try a partial resynchronization later.