summaryrefslogtreecommitdiffstats
path: root/xlators/protocol
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/protocol')
-rw-r--r--xlators/protocol/client/src/client.c10
-rw-r--r--xlators/protocol/client/src/client.h2
2 files changed, 5 insertions, 7 deletions
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c
index 36bf9968b64..0f31fea9511 100644
--- a/xlators/protocol/client/src/client.c
+++ b/xlators/protocol/client/src/client.c
@@ -2172,12 +2172,6 @@ client_mark_fd_bad(xlator_t *this)
pthread_spin_unlock(&conf->fd_lock);
}
-static int
-is_connection_to_brick(struct rpc_clnt *rpc)
-{
- return (rpc->conn.config.remote_port != 0);
-}
-
int
client_rpc_notify(struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
void *data)
@@ -2198,7 +2192,7 @@ client_rpc_notify(struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
switch (event) {
case RPC_CLNT_PING: {
- if (is_connection_to_brick(rpc)) {
+ if (conf->connection_to_brick) {
ret = default_notify(this, GF_EVENT_CHILD_PING, data);
if (ret)
gf_log(this->name, GF_LOG_INFO, "CHILD_PING notify failed");
@@ -2282,11 +2276,13 @@ client_rpc_notify(struct rpc_clnt *rpc, void *mydata, rpc_clnt_event_t event,
conf->skip_notify = 0;
if (conf->quick_reconnect) {
+ conf->connection_to_brick = _gf_true;
conf->quick_reconnect = 0;
rpc_clnt_cleanup_and_start(rpc);
} else {
rpc->conn.config.remote_port = 0;
+ conf->connection_to_brick = _gf_false;
}
break;
case RPC_CLNT_DESTROY:
diff --git a/xlators/protocol/client/src/client.h b/xlators/protocol/client/src/client.h
index 1f05fba444e..3b47d1207bc 100644
--- a/xlators/protocol/client/src/client.h
+++ b/xlators/protocol/client/src/client.h
@@ -159,6 +159,8 @@ typedef struct clnt_conf {
locks when a client disconnects.
*/
+ gf_boolean_t connection_to_brick; /*True from attempt to connect to brick
+ till disconnection to brick*/
} clnt_conf_t;
typedef struct _client_fd_ctx {