From 2ed69d253494bfe2823337a19c53be692255a0b4 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Sun, 28 Feb 2016 11:26:46 +1100 Subject: [PATCH] Allow the socket close to be responsible for removing client fds from the epoll list --- src/connector.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/connector.c b/src/connector.c index 96274f2f..1df23262 100644 --- a/src/connector.c +++ b/src/connector.c @@ -333,12 +333,12 @@ static int __drop_client(cdata_t *cdata, client_instance_t *client) goto out; client->invalid = true; ret = client->fd; + /* Closing the fd will automatically remove it from the epoll list */ Close(client->fd); - epoll_ctl(cdata->epfd, EPOLL_CTL_DEL, ret, NULL); HASH_DEL(cdata->clients, client); DL_APPEND(cdata->dead_clients, client); /* This is the reference to this client's presence in the - * epoll list. */ + * epoll list. */ __dec_instance_ref(client); cdata->dead_generated++; out: