summaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorXavi Hernandez <xhernandez@redhat.com>2018-11-23 10:37:40 +0100
committerXavi Hernandez <xhernandez@redhat.com>2018-11-23 11:05:02 +0100
commita0fdc9202ca37dccab937e166c8ee696d049e08f (patch)
treefbad8b610ea4467de02f3ddc64a5c54465186fa8 /rpc
parent7e691da0d37745e12d2f3e132545db82f05ea8f6 (diff)
core: create a constant for default network timeout
A new constant named GF_NETWORK_TIMEOUT has been defined and all references to the hard-coded timeout of 42 seconds have been replaced with this constant. Change-Id: Id30f5ce4f1230f9288d9e300538624bcf1a6da27 fixes: bz#1652852 Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
Diffstat (limited to 'rpc')
-rw-r--r--rpc/rpc-transport/socket/src/socket.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c
index b1900f08863..a770e6954be 100644
--- a/rpc/rpc-transport/socket/src/socket.c
+++ b/rpc/rpc-transport/socket/src/socket.c
@@ -3928,7 +3928,7 @@ reconfigure(rpc_transport_t *this, dict_t *options)
int ret = 0;
uint32_t backlog = 0;
uint64_t windowsize = 0;
- uint32_t timeout = 42;
+ uint32_t timeout = GF_NETWORK_TIMEOUT;
int keepaliveidle = GF_KEEPALIVE_TIME;
int keepaliveintvl = GF_KEEPALIVE_INTERVAL;
int keepalivecnt = GF_KEEPALIVE_COUNT;
@@ -4393,7 +4393,7 @@ socket_init(rpc_transport_t *this)
gf_boolean_t tmp_bool = 0;
uint64_t windowsize = GF_DEFAULT_SOCKET_WINDOW_SIZE;
char *optstr = NULL;
- uint32_t timeout = 42;
+ uint32_t timeout = GF_NETWORK_TIMEOUT;
int keepaliveidle = GF_KEEPALIVE_TIME;
int keepaliveintvl = GF_KEEPALIVE_INTERVAL;
int keepalivecnt = GF_KEEPALIVE_COUNT;
@@ -4661,7 +4661,7 @@ struct volume_options options[] = {
{.key = {"transport.tcp-user-timeout"},
.type = GF_OPTION_TYPE_INT,
.op_version = {GD_OP_VERSION_3_10_2},
- .default_value = "42"},
+ .default_value = TOSTRING(GF_NETWORK_TIMEOUT)},
{.key = {"transport.socket.nodelay"},
.type = GF_OPTION_TYPE_BOOL,
.default_value = "1"},