From 6d62a498a2757c3d5ce4d87aa1b59b0bb4f836b7 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Mon, 1 Jun 2020 03:52:18 -0400 Subject: [PATCH] [core] more precise check for request stream flags --- src/mod_proxy.c | 5 ++++- src/response.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mod_proxy.c b/src/mod_proxy.c index e0d2cf5e..80d9a9b4 100644 --- a/src/mod_proxy.c +++ b/src/mod_proxy.c @@ -7,6 +7,7 @@ #include "base.h" #include "array.h" #include "buffer.h" +#include "fdevent.h" #include "http_kv.h" #include "http_header.h" #include "log.h" @@ -869,7 +870,9 @@ static handler_t proxy_create_env(gw_handler_ctx *gwhctx) { http_header_remap_uri(b, buffer_string_length(b) - buffer_string_length(&r->target), &hctx->conf.header, 1); int stream_chunked = 0; - if (-1 == r->reqbody_length && r->conf.stream_request_body) { + if (-1 == r->reqbody_length + && (r->conf.stream_request_body + & (FDEVENT_STREAM_REQUEST | FDEVENT_STREAM_REQUEST_BUFMIN))) { stream_chunked = 1; hctx->gw.stdin_append = proxy_stdin_append; } diff --git a/src/response.c b/src/response.c index 796b20b4..4033af15 100644 --- a/src/response.c +++ b/src/response.c @@ -63,7 +63,10 @@ int http_response_write_header(request_st * const r) { r->keep_alive = 0; } else if (0 != r->reqbody_length && r->reqbody_length != r->reqbody_queue->bytes_in - && (NULL == r->handler_module || 0 == r->conf.stream_request_body)) { + && (NULL == r->handler_module + || 0 == (r->conf.stream_request_body + & (FDEVENT_STREAM_REQUEST + | FDEVENT_STREAM_REQUEST_BUFMIN)))) { r->keep_alive = 0; } else { r->con->keep_alive_idle = r->conf.max_keep_alive_idle;