Browse Source

[core] be more precise checking streaming flags

master
Glenn Strauss 12 months ago
parent
commit
ee1f7af24d
  1. 11
      src/connections.c
  2. 4
      src/mod_deflate.c
  3. 3
      src/mod_webdav.c
  4. 5
      src/response.c

11
src/connections.c

@ -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);

4
src/mod_deflate.c

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

3
src/mod_webdav.c

@ -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()*/

5
src/response.c

@ -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__

Loading…
Cancel
Save