From d41eda762e4e98d95d3c80dd849a11e6aec11b56 Mon Sep 17 00:00:00 2001 From: Anand Avati Date: Thu, 18 Aug 2011 11:27:06 +0530 Subject: 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 Tested-by: Gluster Build System --- rpc/rpc-lib/src/rpc-clnt.c | 8 ++++++-- 1 file 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, -- cgit