Browse Source

[mod_ajp13,mod_fastcgi] comment: no response body

add comment for handling of streaming with no response body

add commented-out code to disable streaming to wait for backend protocol
to signal end of response (prevent http_response_write_prepare() from
short-circuiting and finishing responses without response body)

x-ref:
  "FastCGI premature socket close with response streaming and 204 status"
  https://redmine.lighttpd.net/boards/2/topics/10066
master
Glenn Strauss 2 months ago
parent
commit
8d13233b69
  1. 15
      src/mod_ajp13.c
  2. 15
      src/mod_fastcgi.c

15
src/mod_ajp13.c

@ -845,6 +845,21 @@ ajp13_recv_parse (request_st * const r, struct http_response_opts_t * const opts
r->conf.stream_response_body &=
~(FDEVENT_STREAM_RESPONSE|FDEVENT_STREAM_RESPONSE_BUFMIN);
}
#if 0
else if ((r->conf.stream_response_body &
(FDEVENT_STREAM_RESPONSE|FDEVENT_STREAM_RESPONSE_BUFMIN))
&& ( r->http_status == 204
|| r->http_status == 205
|| r->http_status == 304
|| r->http_method == HTTP_METHOD_HEAD)) {
/* disable streaming to wait for backend protocol to signal
* end of response (prevent http_response_write_prepare()
* from short-circuiting and finishing responses without
* response body) */
r->conf.stream_response_body &=
~(FDEVENT_STREAM_RESPONSE|FDEVENT_STREAM_RESPONSE_BUFMIN);
}
#endif
}
else {
log_error(errh, __FILE__, __LINE__,

15
src/mod_fastcgi.c

@ -452,6 +452,21 @@ static handler_t fcgi_recv_parse(request_st * const r, struct http_response_opts
r->conf.stream_response_body &=
~(FDEVENT_STREAM_RESPONSE|FDEVENT_STREAM_RESPONSE_BUFMIN);
}
#if 0
else if ((r->conf.stream_response_body &
(FDEVENT_STREAM_RESPONSE|FDEVENT_STREAM_RESPONSE_BUFMIN))
&& ( r->http_status == 204
|| r->http_status == 205
|| r->http_status == 304
|| r->http_method == HTTP_METHOD_HEAD)) {
/* disable streaming to wait for backend protocol to signal
* end of response (prevent http_response_write_prepare()
* from short-circuiting and finishing responses without
* response body) */
r->conf.stream_response_body &=
~(FDEVENT_STREAM_RESPONSE|FDEVENT_STREAM_RESPONSE_BUFMIN);
}
#endif
} else if (hctx->send_content_body) {
if (0 != mod_fastcgi_transfer_cqlen(r, hctx->rb, packet.len - packet.padding)) {
/* error writing to tempfile;

Loading…
Cancel
Save