>From 93f6899637050a8c00549d8b127c19d5e7aad81a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= <flecai...@haproxy.com>
Date: Wed, 15 Mar 2017 16:36:09 +0100
Subject: [PATCH 24/31] MINOR: server: Make 'default-server' support 'tcp-ut'
 keyword.
X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4

This patch makes 'default-server' directive support 'tcp-ut' keyword.
---
 src/proto_tcp.c | 2 +-
 src/server.c    | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/proto_tcp.c b/src/proto_tcp.c
index 4741651..b664831 100644
--- a/src/proto_tcp.c
+++ b/src/proto_tcp.c
@@ -1833,7 +1833,7 @@ static struct bind_kw_list bind_kws = { "TCP", { }, {
 
 static struct srv_kw_list srv_kws = { "TCP", { }, {
 #ifdef TCP_USER_TIMEOUT
-	{ "tcp-ut",        srv_parse_tcp_ut,        1,  0 }, /* set TCP user timeout on server */
+	{ "tcp-ut",        srv_parse_tcp_ut,        1,  1 }, /* set TCP user timeout on server */
 #endif
 	{ NULL, NULL, 0 },
 }};
diff --git a/src/server.c b/src/server.c
index a9cfac3..7654211 100644
--- a/src/server.c
+++ b/src/server.c
@@ -13,6 +13,7 @@
 
 #include <ctype.h>
 #include <errno.h>
+#include <netinet/tcp.h>
 
 #include <import/xxhash.h>
 
@@ -1435,6 +1436,10 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
 				newsrv->ssl_ctx.ciphers = strdup(curproxy->defsrv.ssl_ctx.ciphers);
 #endif
 
+#ifdef TCP_USER_TIMEOUT
+			newsrv->tcp_ut = curproxy->defsrv.tcp_ut;
+#endif
+
 			cur_arg = 3;
 		} else {
 			newsrv = &curproxy->defsrv;
-- 
2.1.4

Reply via email to