summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2010-10-09 07:41:14 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-10-09 06:36:52 -0700
commit0ccb63dbc52f66975205baf8452d2b57418da4aa (patch)
tree5dd4337db4af6fc5489ef72e0eadc7cb20b9f607
parent13f1fff6da4b2b9ee30f43346cb382abfc1bc304 (diff)
set keepalive for client connections
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1802 (Gluster volume creation failed) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1802
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index ba9aeb8f95c..8254569658c 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -2265,6 +2265,7 @@ glusterd_friend_add (const char *hoststr, int port,
glusterd_peer_hostname_t *name = NULL;
char *hostname = NULL;
glusterd_peerctx_t *peerctx = NULL;
+ int32_t intvl = 0;
priv = THIS->private;
@@ -2312,6 +2313,26 @@ glusterd_friend_add (const char *hoststr, int port,
goto out;
}
+ ret = dict_get_int32 (THIS->options,
+ "transport.socket.keepalive-interval",
+ &intvl);
+ if (!ret) {
+ ret = dict_set_int32 (options,
+ "transport.socket.keepalive-interval", intvl);
+ if (ret)
+ goto out;
+ }
+
+ ret = dict_get_int32 (THIS->options,
+ "transport.socket.keepalive-time",
+ &intvl);
+ if (!ret) {
+ ret = dict_set_int32 (options,
+ "transport.socket.keepalive-time", intvl);
+ if (ret)
+ goto out;
+ }
+
hostname = gf_strdup((char*)hoststr);
if (!hostname) {
ret = -1;