From 60341b82ba484ab96f476fb782aa431b0c9b5f97 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Wed, 3 Jun 2009 00:38:26 +0000 Subject: server-helpers: cleanup connection only if there are no active transports. - thanks to Ioannis Aslanidis for reporting. - breakup the server_connection_cleanup into smaller procedures. - do following operations in a single atomic operation. 1. conn->active_transports-- 2. collecting pointer to lock table and all fds if there are no active transports this will avoid any race conditions. Signed-off-by: Anand V. Avati --- xlators/protocol/server/src/server-protocol.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'xlators/protocol/server/src/server-protocol.c') diff --git a/xlators/protocol/server/src/server-protocol.c b/xlators/protocol/server/src/server-protocol.c index 7fc379efb..47bc2ae96 100644 --- a/xlators/protocol/server/src/server-protocol.c +++ b/xlators/protocol/server/src/server-protocol.c @@ -7803,6 +7803,10 @@ notify (xlator_t *this, int32_t event, void *data, ...) "handshake with (%s) is successful", myinfo->identifier, peerinfo->identifier); } else { + /* + * FIXME: shouldn't we check for return value? + * what should be done if cleanup fails? + */ server_connection_cleanup (this, trans->xl_private); } } -- cgit