summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/server/src/server-protocol.c
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@zresearch.com>2009-06-03 00:38:26 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-06-08 06:47:40 -0700
commit60341b82ba484ab96f476fb782aa431b0c9b5f97 (patch)
treee1d053b2b3ed8c33bc88bfca7524c937a00793ce /xlators/protocol/server/src/server-protocol.c
parentc8c33da4e4b20f4dc717bdcac7a6fa10f8cb323a (diff)
server-helpers: cleanup connection only if there are no active transports.
- thanks to Ioannis Aslanidis <iaslanidis@flumotion.com> 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 <avati@dev.gluster.com>
Diffstat (limited to 'xlators/protocol/server/src/server-protocol.c')
-rw-r--r--xlators/protocol/server/src/server-protocol.c4
1 files changed, 4 insertions, 0 deletions
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);
}
}