From 4328d6412d30ce538ec87e1f124ebe3b2a0e131e Mon Sep 17 00:00:00 2001 From: Mohammed Rafi KC Date: Mon, 29 May 2017 16:19:40 +0530 Subject: socket/reconfigure: reconfigure should be done on new dict In socket reconfigure, reconfigurations are doing with old dict values. It should be with new reconfigured dict values Backport of> >Change-Id: Iac5ad4382fe630806af14c99bb7950a288756a87 >BUG: 1456405 >Signed-off-by: Mohammed Rafi KC >Reviewed-on: https://review.gluster.org/17412 >Smoke: Gluster Build System >NetBSD-regression: NetBSD Build System >CentOS-regression: Gluster Build System >Reviewed-by: Raghavendra G Change-Id: Iac5ad4382fe630806af14c99bb7950a288756a87 BUG: 1463517 Signed-off-by: Mohammed Rafi KC Reviewed-on: https://review.gluster.org/17588 Smoke: Gluster Build System CentOS-regression: Gluster Build System Reviewed-by: Zhou Zhengping Reviewed-by: Shyamsundar Ranganathan --- rpc/rpc-transport/socket/src/socket.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c index e14152c5822..b5eeba085c1 100644 --- a/rpc/rpc-transport/socket/src/socket.c +++ b/rpc/rpc-transport/socket/src/socket.c @@ -3860,7 +3860,7 @@ reconfigure (rpc_transport_t *this, dict_t *options) priv = this->private; - if (dict_get_str (this->options, "transport.socket.keepalive", + if (dict_get_str (options, "transport.socket.keepalive", &optstr) == 0) { if (gf_string2boolean (optstr, &tmp_bool) == -1) { gf_log (this->name, GF_LOG_ERROR, @@ -3877,33 +3877,33 @@ reconfigure (rpc_transport_t *this, dict_t *options) else priv->keepalive = 1; - if (dict_get_int32 (this->options, "transport.tcp-user-timeout", + if (dict_get_int32 (options, "transport.tcp-user-timeout", &(priv->timeout)) != 0) priv->timeout = timeout; gf_log (this->name, GF_LOG_DEBUG, "Reconfigued " "transport.tcp-user-timeout=%d", priv->timeout); - if (dict_get_int32 (this->options, "transport.socket.keepalive-time", + if (dict_get_int32 (options, "transport.socket.keepalive-time", &(priv->keepaliveidle)) != 0) priv->keepaliveidle = keepaliveidle; gf_log (this->name, GF_LOG_DEBUG, "Reconfigued " "transport.socket.keepalive-time=%d", priv->keepaliveidle); - if (dict_get_int32 (this->options, + if (dict_get_int32 (options, "transport.socket.keepalive-interval", &(priv->keepaliveintvl)) != 0) priv->keepaliveintvl = keepaliveintvl; gf_log (this->name, GF_LOG_DEBUG, "Reconfigued " "transport.socket.keepalive-interval=%d", priv->keepaliveintvl); - if (dict_get_int32 (this->options, "transport.socket.keepalive-count", + if (dict_get_int32 (options, "transport.socket.keepalive-count", &(priv->keepalivecnt)) != 0) priv->keepalivecnt = keepalivecnt; gf_log (this->name, GF_LOG_DEBUG, "Reconfigued " "transport.socket.keepalive-count=%d", priv->keepalivecnt); optstr = NULL; - if (dict_get_str (this->options, "tcp-window-size", + if (dict_get_str (options, "tcp-window-size", &optstr) == 0) { if (gf_string2uint64 (optstr, &windowsize) != 0) { gf_log (this->name, GF_LOG_ERROR, @@ -3914,8 +3914,8 @@ reconfigure (rpc_transport_t *this, dict_t *options) priv->windowsize = (int)windowsize; - if (dict_get (this->options, "non-blocking-io")) { - optstr = data_to_str (dict_get (this->options, + if (dict_get (options, "non-blocking-io")) { + optstr = data_to_str (dict_get (options, "non-blocking-io")); if (gf_string2boolean (optstr, &tmp_bool) == -1) { -- cgit