summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rpc/rpc-lib/src/rpc-clnt.c4
-rw-r--r--rpc/rpc-lib/src/rpc-transport.h3
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c3
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c2
4 files changed, 9 insertions, 3 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c
index fa3bc81ff..8cf7f7444 100644
--- a/rpc/rpc-lib/src/rpc-clnt.c
+++ b/rpc/rpc-lib/src/rpc-clnt.c
@@ -823,7 +823,7 @@ rpc_clnt_notify (rpc_transport_t *trans, void *mydata,
switch (event) {
case RPC_TRANSPORT_DISCONNECT:
{
- rpc_clnt_connection_cleanup (&clnt->conn);
+ rpc_clnt_connection_cleanup (conn);
pthread_mutex_lock (&conn->lock);
{
@@ -1474,7 +1474,7 @@ rpc_clnt_destroy (struct rpc_clnt *rpc)
return;
if (rpc->conn.trans)
- rpc_transport_unref (rpc->conn.trans);
+ rpc_transport_destroy (rpc->conn.trans);
rpc_clnt_connection_cleanup (&rpc->conn);
rpc_clnt_reconnect_cleanup (&rpc->conn);
diff --git a/rpc/rpc-lib/src/rpc-transport.h b/rpc/rpc-lib/src/rpc-transport.h
index 560eae453..c5e7755ff 100644
--- a/rpc/rpc-lib/src/rpc-transport.h
+++ b/rpc/rpc-lib/src/rpc-transport.h
@@ -247,6 +247,9 @@ int32_t
rpc_transport_disconnect (rpc_transport_t *this);
int32_t
+rpc_transport_destroy (rpc_transport_t *this);
+
+int32_t
rpc_transport_notify (rpc_transport_t *this, rpc_transport_event_t event,
void *data, ...);
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 70734074f..dcc408eb0 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -3182,6 +3182,9 @@ glusterd_rpc_notify (struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
glusterd_peerctx_t *peerctx = NULL;
peerctx = mydata;
+ if (!peerctx)
+ return 0;
+
peerinfo = peerctx->peerinfo;
this = THIS;
conf = this->private;
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index cceecc11c..6475ca277 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -754,9 +754,9 @@ glusterd_friend_cleanup (glusterd_peerinfo_t *peerinfo)
if (peerinfo->rpc) {
peerctx = peerinfo->rpc->mydata;
peerinfo->rpc->mydata = NULL;
- GF_FREE (peerctx);
peerinfo->rpc = rpc_clnt_unref (peerinfo->rpc);
peerinfo->rpc = NULL;
+ GF_FREE (peerctx);
}
glusterd_peer_destroy (peerinfo);