Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/in_elasticsearch/in_elasticsearch.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ static int in_elasticsearch_bulk_init(struct flb_input_instance *ins,
if (ctx->enable_http2) {
ret = flb_http_server_init(&ctx->http_server,
HTTP_PROTOCOL_AUTODETECT,
FLB_HTTP_SERVER_FLAG_AUTO_INFLATE,
(FLB_HTTP_SERVER_FLAG_KEEPALIVE | FLB_HTTP_SERVER_FLAG_AUTO_INFLATE),
NULL,
ins->host.listen,
ins->host.port,
Expand Down
2 changes: 1 addition & 1 deletion plugins/in_http/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static int in_http_init(struct flb_input_instance *ins,
if (ctx->enable_http2) {
ret = flb_http_server_init(&ctx->http_server,
HTTP_PROTOCOL_AUTODETECT,
FLB_HTTP_SERVER_FLAG_AUTO_INFLATE,
(FLB_HTTP_SERVER_FLAG_KEEPALIVE | FLB_HTTP_SERVER_FLAG_AUTO_INFLATE),
NULL,
ins->host.listen,
ins->host.port,
Expand Down
2 changes: 1 addition & 1 deletion plugins/in_opentelemetry/opentelemetry.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static int in_opentelemetry_init(struct flb_input_instance *ins,
if (ctx->enable_http2) {
ret = flb_http_server_init(&ctx->http_server,
HTTP_PROTOCOL_AUTODETECT,
FLB_HTTP_SERVER_FLAG_AUTO_INFLATE,
(FLB_HTTP_SERVER_FLAG_KEEPALIVE | FLB_HTTP_SERVER_FLAG_AUTO_INFLATE),
NULL,
ins->host.listen,
ins->host.port,
Expand Down
2 changes: 1 addition & 1 deletion plugins/in_splunk/splunk.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ static int in_splunk_init(struct flb_input_instance *ins,
if (ctx->enable_http2) {
ret = flb_http_server_init(&ctx->http_server,
HTTP_PROTOCOL_AUTODETECT,
FLB_HTTP_SERVER_FLAG_AUTO_INFLATE,
(FLB_HTTP_SERVER_FLAG_KEEPALIVE | FLB_HTTP_SERVER_FLAG_AUTO_INFLATE),
NULL,
ins->host.listen,
ins->host.port,
Expand Down
7 changes: 6 additions & 1 deletion src/flb_http_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,11 @@ void flb_http_stream_destroy(struct flb_http_stream *stream)
cfl_list_del(&stream->_head);
}

flb_free(stream);
flb_http_request_destroy(&stream->request);
flb_http_response_destroy(&stream->response);

if (stream->releasable) {
flb_free(stream);
}
}
}
14 changes: 12 additions & 2 deletions src/http_server/flb_http_server_http1.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,14 @@ static int http1_session_process_request(struct flb_http1_server_session *sessio
struct mk_http_header *header;
int result;

result = flb_http_request_init(&session->stream.request);

if (result != 0) {
return -1;
}

session->stream.request.stream = &session->stream;

if (session->inner_request.uri_processed.data != NULL) {
session->stream.request.path = \
cfl_sds_create_len(session->inner_request.uri_processed.data,
Expand Down Expand Up @@ -450,7 +458,7 @@ int flb_http1_server_session_init(struct flb_http1_server_session *session,

mk_http_parser_init(&session->inner_parser);

result = flb_http_stream_init(&session->stream, parent, 0, HTTP_STREAM_ROLE_SERVER,
result = flb_http_stream_init(&session->stream, parent, 0, HTTP_STREAM_ROLE_SERVER,
user_data);

if (result != 0) {
Expand All @@ -471,11 +479,13 @@ void flb_http1_server_session_destroy(struct flb_http1_server_session *session)
session->inner_session.channel = NULL;
}

flb_http_stream_destroy(&session->stream);

session->initialized = FLB_FALSE;
}
}

int flb_http1_server_session_ingest(struct flb_http1_server_session *session,
int flb_http1_server_session_ingest(struct flb_http1_server_session *session,
unsigned char *buffer,
size_t length)
{
Expand Down