path: root/rpc/rpc-transport
diff options
authorJeff Darcy <>2013-01-29 10:50:01 -0500
committerAnand Avati <>2013-01-29 10:01:01 -0800
commitfed0752313c37c500d3b88f0651c4923cec4cf9b (patch)
tree9b85c4e9c5e9cd4d910ee0f46cd7a1c4f631fc6a /rpc/rpc-transport
parentc3f1c0c18a04615cb33040748d1eae558a9203b5 (diff)
socket: null out priv->ssl_ssl on disconnect
This prevents problems when a socket transport is reused for a non-SSL connection (e.g. glusterd portmapper) after having been used for an SSL connection (e.g. a brick). In that case, ssl_ssl will still be non-null from the first connection, even though the structure it points to has actually been freed. I'm not sure why/how we would reuse a socket transport in this way (the case of SSL after non-SSL has been common for a long time) but recent glusterd changes seem to have had that effect. Change-Id: I46f1ff3c409c122478bf720a7f02d92abcc32bed BUG: 902684 Signed-off-by: Jeff Darcy <> Reviewed-on: Tested-by: Gluster Build System <> Reviewed-by: Anand Avati <>
Diffstat (limited to 'rpc/rpc-transport')
1 files changed, 2 insertions, 0 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c
index 9494362bc..7657e5d35 100644
--- a/rpc/rpc-transport/socket/src/socket.c
+++ b/rpc/rpc-transport/socket/src/socket.c
@@ -605,6 +605,7 @@ __socket_disconnect (rpc_transport_t *this)
+ priv->ssl_ssl = NULL;
if (priv->own_thread) {
@@ -3241,6 +3242,7 @@ socket_init (rpc_transport_t *this)
if (!priv) {
return -1;
+ memset(priv,0,sizeof(*priv));
pthread_mutex_init (&priv->lock, NULL);