From c32719c3abe36f75fd288def0aca9968184be1e0 Mon Sep 17 00:00:00 2001 From: Leonardo Alminana Date: Mon, 19 Aug 2024 19:45:53 +0200 Subject: [PATCH] upstream: added tcp keepalive settings Signed-off-by: Leonardo Alminana --- src/flb_upstream.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/flb_upstream.c b/src/flb_upstream.c index b68a5d8c876..959c1bb5cf3 100644 --- a/src/flb_upstream.c +++ b/src/flb_upstream.c @@ -71,6 +71,32 @@ struct flb_config_map upstream_net[] = { "Set maximum time allowed for an idle Keepalive connection" }, + { + FLB_CONFIG_MAP_BOOL, "net.tcp_keepalive", "off", + 0, FLB_TRUE, offsetof(struct flb_net_setup, tcp_keepalive), + "Enable or disable the use of TCP keepalive probes" + }, + + { + FLB_CONFIG_MAP_INT, "net.tcp_keepalive_time", "-1", + 0, FLB_TRUE, offsetof(struct flb_net_setup, tcp_keepalive_time), + "interval between the last data packet sent and the first " + "TCP keepalive probe" + }, + + { + FLB_CONFIG_MAP_INT, "net.tcp_keepalive_interval", "-1", + 0, FLB_TRUE, offsetof(struct flb_net_setup, tcp_keepalive_interval), + "interval between TCP keepalive probes when no response is" + "received on a keepidle probe" + }, + + { + FLB_CONFIG_MAP_INT, "net.tcp_keepalive_probes", "-1", + 0, FLB_TRUE, offsetof(struct flb_net_setup, tcp_keepalive_probes), + "number of unacknowledged probes to consider a connection dead" + }, + { FLB_CONFIG_MAP_TIME, "net.io_timeout", "0s", 0, FLB_TRUE, offsetof(struct flb_net_setup, io_timeout),