Blob Blame History Raw
From c9e6e48b5a38c796d5c3f7139980a75753464610 Mon Sep 17 00:00:00 2001
From: Mohammed Rafi KC <rkavunga@redhat.com>
Date: Mon, 29 May 2017 16:19:40 +0530
Subject: [PATCH 500/509] 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 <rkavunga@redhat.com>
>Reviewed-on: https://review.gluster.org/17412
>Smoke: Gluster Build System <jenkins@build.gluster.org>
>NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
>CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
>Reviewed-by: Raghavendra G <rgowdapp@redhat.com>

Change-Id: Iac5ad4382fe630806af14c99bb7950a288756a87
BUG: 1453145
Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/108899
Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
---
 rpc/rpc-transport/socket/src/socket.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c
index 10f59ee..16cba78 100644
--- a/rpc/rpc-transport/socket/src/socket.c
+++ b/rpc/rpc-transport/socket/src/socket.c
@@ -3854,7 +3854,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,
@@ -3871,7 +3871,7 @@ reconfigure (rpc_transport_t *this, dict_t *options)
         else
                 priv->keepalive = 1;
 
-        if (dict_get_uint32 (this->options, "transport.tcp-user-timeout",
+        if (dict_get_uint32 (options, "transport.tcp-user-timeout",
                              &timeout) == 0) {
                 priv->timeout = timeout;
                 gf_log (this->name, GF_LOG_DEBUG, "Reconfigued "
@@ -3879,8 +3879,7 @@ reconfigure (rpc_transport_t *this, dict_t *options)
         }
 
         optstr = NULL;
-        if (dict_get_str (this->options, "tcp-window-size",
-                          &optstr) == 0) {
+        if (dict_get_str (options, "tcp-window-size", &optstr) == 0) {
                 if (gf_string2uint64 (optstr, &windowsize) != 0) {
                         gf_log (this->name, GF_LOG_ERROR,
                                 "invalid number format: %s", optstr);
@@ -3890,8 +3889,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) {
-- 
1.8.3.1