From: Sebastian Harl Date: Thu, 10 Apr 2014 19:44:18 +0000 (+0200) Subject: frontend: Close a connection when receiving an exception of the fd. X-Git-Tag: sysdb-0.1.0~132^2~2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=3a61ffc8d3d061ee69e7b71d92cf1a036350012c;p=sysdb.git frontend: Close a connection when receiving an exception of the fd. --- diff --git a/src/frontend/sock.c b/src/frontend/sock.c index 3b97994..70f22d7 100644 --- a/src/frontend/sock.c +++ b/src/frontend/sock.c @@ -381,9 +381,14 @@ socket_handle_incoming(sdb_fe_socket_t *sock, while (sdb_llist_iter_has_next(iter)) { sdb_object_t *obj = sdb_llist_iter_get_next(iter); - if (FD_ISSET(CONN(obj)->fd, exceptions)) + if (FD_ISSET(CONN(obj)->fd, exceptions)) { sdb_log(SDB_LOG_INFO, "Exception on fd %d", CONN(obj)->fd); + /* close the connection */ + sdb_llist_iter_remove_current(iter); + sdb_object_deref(obj); + continue; + } if (FD_ISSET(CONN(obj)->fd, ready)) { sdb_llist_iter_remove_current(iter);