Browse Source

Allow the socket close to be responsible for removing client fds from the epoll list

master
Con Kolivas 9 years ago
parent
commit
2ed69d2534
  1. 4
      src/connector.c

4
src/connector.c

@ -333,12 +333,12 @@ static int __drop_client(cdata_t *cdata, client_instance_t *client)
goto out; goto out;
client->invalid = true; client->invalid = true;
ret = client->fd; ret = client->fd;
/* Closing the fd will automatically remove it from the epoll list */
Close(client->fd); Close(client->fd);
epoll_ctl(cdata->epfd, EPOLL_CTL_DEL, ret, NULL);
HASH_DEL(cdata->clients, client); HASH_DEL(cdata->clients, client);
DL_APPEND(cdata->dead_clients, client); DL_APPEND(cdata->dead_clients, client);
/* This is the reference to this client's presence in the /* This is the reference to this client's presence in the
* epoll list. */ * epoll list. */
__dec_instance_ref(client); __dec_instance_ref(client);
cdata->dead_generated++; cdata->dead_generated++;
out: out:

Loading…
Cancel
Save