[core] be more precise checking streaming flags

personal/stbuehler/tests-path
Glenn Strauss 2020-10-06 11:22:36 -04:00
parent f7fc8d8d75
commit ee1f7af24d
4 changed files with 17 additions and 6 deletions

View File

@ -1320,7 +1320,10 @@ connection_state_machine_h2 (request_st * const h2r, connection * const con)
connection_state_machine_loop(r, con);
if (r->resp_header_len && !chunkqueue_is_empty(&r->write_queue)
&& (r->resp_body_finished || r->conf.stream_response_body)) {
&& (r->resp_body_finished
|| (r->conf.stream_response_body
& (FDEVENT_STREAM_RESPONSE
|FDEVENT_STREAM_RESPONSE_BUFMIN)))) {
chunkqueue * const cq = &r->write_queue;
off_t avail = chunkqueue_length(cq);
@ -1793,8 +1796,10 @@ connection_handle_read_post_chunked (request_st * const r, chunkqueue * const cq
}
hsz = p + 4 - (c->mem->ptr+c->offset);
/* trailers currently ignored, but could be processed
* here if 0 == r->conf.stream_request_body, taking
* care to reject any fields forbidden in trailers,
* here if 0 == (r->conf.stream_request_body &
* & (FDEVENT_STREAM_REQUEST
* |FDEVENT_STREAM_REQUEST_BUFMIN))
* taking care to reject fields forbidden in trailers,
* making trailers available to CGI and other backends*/
}
chunkqueue_mark_written(cq, (size_t)hsz);

View File

@ -1558,7 +1558,9 @@ REQUEST_FUNC(mod_deflate_handle_response_start) {
/* enable compression */
p->conf.sync_flush =
(r->conf.stream_response_body && 0 == p->conf.output_buffer_size);
((r->conf.stream_response_body
& (FDEVENT_STREAM_RESPONSE | FDEVENT_STREAM_RESPONSE_BUFMIN))
&& 0 == p->conf.output_buffer_size);
hctx = handler_ctx_init();
hctx->plugin_data = p;
hctx->compression_type = compression_type;

View File

@ -5732,7 +5732,8 @@ PHYSICALPATH_FUNC(mod_webdav_physical_handler)
}
r->handler_module = ((plugin_data *)p_d)->self;
r->conf.stream_request_body = 0;
r->conf.stream_request_body &=
~(FDEVENT_STREAM_REQUEST | FDEVENT_STREAM_REQUEST_BUFMIN);
r->plugin_ctx[((plugin_data *)p_d)->id] = &pconf;
const handler_t rc =
mod_webdav_subrequest_handler(r, p_d); /*p->handle_subrequest()*/

View File

@ -1022,7 +1022,10 @@ http_response_handler (request_st * const r)
switch (rc) {
case HANDLER_WAIT_FOR_EVENT:
if (!r->resp_body_finished
&& (!r->resp_body_started || 0 == r->conf.stream_response_body))
&& (!r->resp_body_started
|| 0 == (r->conf.stream_response_body
& (FDEVENT_STREAM_RESPONSE
|FDEVENT_STREAM_RESPONSE_BUFMIN))))
return HANDLER_WAIT_FOR_EVENT; /* come back here */
/* response headers received from backend; start response */
__attribute_fallthrough__