[sheepdog] [PATCH] sheep: try to clear conn.blocking_siblings when EPOLLERR/EPOLLHUP occur

Yunkai Zhang yunkai.me at gmail.com
Fri Jun 29 09:26:44 CEST 2012


From: Yunkai Zhang <qiushu.zyk at taobao.com>


Signed-off-by: Yunkai Zhang <qiushu.zyk at taobao.com>
---
 sheep/sdnet.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sheep/sdnet.c b/sheep/sdnet.c
index 04eb4c1..a4f0db3 100644
--- a/sheep/sdnet.c
+++ b/sheep/sdnet.c
@@ -738,11 +738,13 @@ static void client_handler(int fd, int events, void *data)
 		client_tx_handler(ci);
 
 	if (is_conn_dead(&ci->conn)) {
-		if (!list_empty(&ci->conn.blocking_siblings))
-			list_del_init(&ci->conn.blocking_siblings);
 err:
 		dprintf("closed connection %d, %s:%d\n", fd,
 			ci->conn.ipstr, ci->conn.port);
+
+		if (!list_empty(&ci->conn.blocking_siblings))
+			list_del_init(&ci->conn.blocking_siblings);
+
 		unregister_event(fd);
 		client_decref(ci);
 	}
-- 
1.7.10.2




More information about the sheepdog mailing list