Browse Source

[core] more precise check for request stream flags

personal/stbuehler/ci-build
Glenn Strauss 2 years ago
parent
commit
6d62a498a2
  1. 5
      src/mod_proxy.c
  2. 5
      src/response.c

5
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;
}

5
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;

Loading…
Cancel
Save