summaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorAnand Avati <avati@gluster.com>2011-08-18 11:27:06 +0530
committerAnand Avati <avati@gluster.com>2011-08-17 23:03:18 -0700
commitd41eda762e4e98d95d3c80dd849a11e6aec11b56 (patch)
treea9f03e074ef6b24cf4d545c4359708277b59c360 /rpc
parentc0180cc22f5f52f5776c74a6d1ae90100dbb5087 (diff)
rpc-clnt: fix merge error of http://review.gluster.com/248
cherrypicked patch did not have the logic to reset port number to reconnect to glusterd. Change-Id: I78c903d5a28626f83b5024bd323e77b5f159e374 BUG: 3409 Reviewed-on: http://review.gluster.com/254 Reviewed-by: Amar Tumballi <amar@gluster.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'rpc')
-rw-r--r--rpc/rpc-lib/src/rpc-clnt.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/rpc/rpc-lib/src/rpc-clnt.c b/rpc/rpc-lib/src/rpc-clnt.c
index c77882dd6de..5545f7e2ebe 100644
--- a/rpc/rpc-lib/src/rpc-clnt.c
+++ b/rpc/rpc-lib/src/rpc-clnt.c
@@ -1411,8 +1411,12 @@ rpc_clnt_submit (struct rpc_clnt *rpc, rpc_clnt_prog_t *prog,
pthread_mutex_lock (&conn->lock);
{
if (conn->connected == 0) {
- rpc_transport_connect (conn->trans,
- conn->config.remote_port);
+ ret = rpc_transport_connect (conn->trans,
+ conn->config.remote_port);
+ /* Below code makes sure the (re-)configured port lasts
+ for just one successful connect attempt */
+ if (!ret)
+ conn->config.remote_port = 0;
}
ret = rpc_transport_submit_request (rpc->conn.trans,