diff --git a/plugins/in_splunk/splunk.c b/plugins/in_splunk/splunk.c index 97065c8844a..b3a4217eefa 100644 --- a/plugins/in_splunk/splunk.c +++ b/plugins/in_splunk/splunk.c @@ -69,7 +69,6 @@ static int in_splunk_init(struct flb_input_instance *ins, unsigned short int port; int ret; struct flb_splunk *ctx; - int http2_flags = 0; (void) data; @@ -96,13 +95,9 @@ static int in_splunk_init(struct flb_input_instance *ins, if (ctx->enable_http2) { - http2_flags = FLB_HTTP_SERVER_FLAG_AUTO_INFLATE; - if (ctx->auto_keepalive) { - http2_flags |= FLB_HTTP_SERVER_FLAG_KEEPALIVE; - } ret = flb_http_server_init(&ctx->http_server, HTTP_PROTOCOL_AUTODETECT, - http2_flags, + FLB_HTTP_SERVER_FLAG_AUTO_INFLATE, NULL, ins->host.listen, ins->host.port, @@ -217,12 +212,6 @@ static struct flb_config_map config_map[] = { NULL }, - { - FLB_CONFIG_MAP_BOOL, "keepalive", "Off", - 0, FLB_TRUE, offsetof(struct flb_splunk, auto_keepalive), - "Enable keepalive automatically when enabled HTTP2" - }, - { FLB_CONFIG_MAP_SIZE, "buffer_max_size", HTTP_BUFFER_MAX_SIZE, 0, FLB_TRUE, offsetof(struct flb_splunk, buffer_max_size), diff --git a/plugins/in_splunk/splunk.h b/plugins/in_splunk/splunk.h index 4d1462455b7..e72905b5a80 100644 --- a/plugins/in_splunk/splunk.h +++ b/plugins/in_splunk/splunk.h @@ -59,9 +59,6 @@ struct flb_splunk { int enable_http2; struct flb_http_server http_server; - /* Auto Keepalive? */ - int auto_keepalive; - /* Legacy HTTP server */ flb_sds_t success_headers_str; int collector_id; diff --git a/src/flb_downstream.c b/src/flb_downstream.c index fa014a90242..a63a831a646 100644 --- a/src/flb_downstream.c +++ b/src/flb_downstream.c @@ -60,6 +60,11 @@ struct flb_config_map downstream_net[] = { "disabled, the timeout is logged as a debug message" }, + { + FLB_CONFIG_MAP_BOOL, "net.keepalive", "true", + 0, FLB_TRUE, offsetof(struct flb_net_setup, keepalive), + "Enable keepalive on setup downstream", + }, /* EOF */ {0} }; diff --git a/src/http_server/flb_http_server.c b/src/http_server/flb_http_server.c index 302ded9be6a..d02504c4b5f 100644 --- a/src/http_server/flb_http_server.c +++ b/src/http_server/flb_http_server.c @@ -485,6 +485,10 @@ int flb_http_server_init(struct flb_http_server *session, session->downstream = NULL; + if (networking_setup->keepalive) { + session->flags = FLB_HTTP_SERVER_FLAG_KEEPALIVE | FLB_HTTP_SERVER_FLAG_AUTO_INFLATE; + } + cfl_list_init(&session->clients); MK_EVENT_NEW(&session->listener_event);