@@ -193,6 +193,15 @@ static int http_post(struct flb_out_http *ctx,
193
193
*/
194
194
c -> cb_ctx = ctx -> ins -> callback ;
195
195
196
+ flb_http_set_response_timeout (c , ctx -> response_timeout );
197
+
198
+ if (ctx -> read_idle_timeout > 0 ) {
199
+ flb_http_set_read_idle_timeout (c , ctx -> read_idle_timeout );
200
+ }
201
+ else {
202
+ flb_http_set_read_idle_timeout (c , ctx -> ins -> net_setup .io_timeout );
203
+ }
204
+
196
205
/* Append headers */
197
206
if (headers ) {
198
207
append_headers (c , headers );
@@ -678,6 +687,16 @@ static struct flb_config_map config_map[] = {
678
687
0 , FLB_TRUE , offsetof(struct flb_out_http , log_response_payload ),
679
688
"Specify if the response paylod should be logged or not"
680
689
},
690
+ {
691
+ FLB_CONFIG_MAP_TIME , "http.response_timeout" , "60s" ,
692
+ 0 , FLB_TRUE , offsetof(struct flb_out_http , response_timeout ),
693
+ "Set maximum time to wait for a server response"
694
+ },
695
+ {
696
+ FLB_CONFIG_MAP_TIME , "http.read_idle_timeout" , "0s" ,
697
+ 0 , FLB_TRUE , offsetof(struct flb_out_http , read_idle_timeout ),
698
+ "Set maximum allowed time between two consecutive reads"
699
+ },
681
700
{
682
701
FLB_CONFIG_MAP_STR , "http_user" , NULL ,
683
702
0 , FLB_TRUE , offsetof(struct flb_out_http , http_user ),
0 commit comments