From 3bf4e0de8d5388712a9e38190868a83b2ce99c8a Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Fri, 3 Oct 2014 22:38:16 +1000 Subject: [PATCH] Always send dropclient to the stratifier on every invalidate client call --- src/connector.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/connector.c b/src/connector.c index e6bf60d7..7c9e28b1 100644 --- a/src/connector.c +++ b/src/connector.c @@ -169,11 +169,8 @@ static int drop_client(conn_instance_t *ci, client_instance_t *client) static void invalidate_client(ckpool_t *ckp, conn_instance_t *ci, client_instance_t *client) { char buf[256]; - int fd; - fd = drop_client(ci, client); - if (fd == -1) - return; + drop_client(ci, client); if (ckp->passthrough) return; sprintf(buf, "dropclient=%ld", client->id); @@ -459,7 +456,8 @@ static void send_client(conn_instance_t *ci, int64_t id, char *buf) if (unlikely(fd == -1)) { if (client) { - LOGINFO("Client id %ld disconnected", id); + /* This shouldn't happen */ + LOGWARNING("Client id %ld disconnected but fd already invalidated!", id); invalidate_client(ci->pi->ckp, ci, client); } else LOGINFO("Connector failed to find client id %ld to send to", id);