defer reading request body until handle subrequest (fixes #2541)
commitc263bc6a119faa52a2e2ffd65bb986213fd5280e
authorGlenn Strauss <gstrauss@gluelogic.com>
Thu, 7 Apr 2016 23:47:49 +0000 (7 19:47 -0400)
committerGlenn Strauss <gstrauss@gluelogic.com>
Mon, 18 Apr 2016 10:19:03 +0000 (18 06:19 -0400)
treedef5e68574b6b4ec57a4fd825bb583e6240cb31e
parentbbbbfb3de0db3a09cd3fb91f5287fc004c337a37
defer reading request body until handle subrequest (fixes #2541)

read request body right before calling subrequest handler,
allowing request to be handled prior to reading request body,
e.g. to send 401 Unauthorized response when authentication is required

(In the future, this might move into each dynamic handler which supports
 request body (mod_cgi, mod_fastcgi, mod_proxy, mod_scgi, mod_webdav) so
 that each dynamic handler can choose whether or not to buffer request
 body or to stream request body to backend as request body is received.)

keep-alive is disabled if request body has not been completely read
prior to sending response

x-ref:
  "HTTP 401 Unauthorized only sent back after full POST request is read"
  https://redmine.lighttpd.net/issues/2541
src/connections.c
src/connections.h
src/mod_cgi.c
src/mod_fastcgi.c
src/mod_proxy.c
src/mod_scgi.c
src/response.c