You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Garrett Rooney <ro...@electricjellyfish.net> on 2005/12/27 19:54:09 UTC
[PATCH] mod_proxy_fcgi - add support for reading stdout from fcgi process
This patch makes the code for talking to the back end fastcgi process
use apr_poll, interleaving reads and writes as they become ready.
Note that it doesn't actually switch to nonblocking reads/writes, but
that can be done in another pass. This also switches to AP_IOBUFSIZE
for the read/write buffers as suggested by Justin, and more
importantly adds support for the FCGI_STDOUT so we can actually send
data from the back end fastcgi process to the front end client.
Log follows, patch attached. Comments, as always, are more than welcome.
-garrett
Add support for reading FCGI_STDOUT and FCGI_END_REQUEST records from the
back end fastcgi process. This includes switching to a poll based dispatch
loop that handles interleaved reads and writes.
* modules/proxy/mod_proxy_fcgi.c
(MAX_INPUT_BYTES): Removed, we now use AP_IOBUFSIZE.
(send_stdin): Removed, code incorporated into dispatch routine.
(dispatch): New, poll based dispatch loop that handles both reads and
writes.
(fcgi_do_request): Call new dispatch routine. Return OK if we get through
without errors.
Re: [PATCH] mod_proxy_fcgi - add support for reading stdout from fcgi process
Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 12/27/05, Garrett Rooney <ro...@electricjellyfish.net> wrote:
> On 12/27/05, Garrett Rooney <ro...@electricjellyfish.net> wrote:
>
> > Comments, as always, are more than welcome.
>
> As Paul pointed out on IRC, this patch fails to parse the HTTP headers
> coming back from the back end fastcgi process. Here's an updated
> version that fixes that. Log follows, patch attached.
Let's just pretend that patch never existed, since it clearly doesn't
work, I must have been out of my mind when I said it did. This one is
better, not perfect (it'll still fail to parse the headers if the
\r\n\r\n is split over multiple fastcgi records, and it's too strict
about requiring \r\n as opposed to \n), but it at least functions
correctly in the basic case.
-garrett
Add support for reading FCGI_STDOUT and FCGI_END_REQUEST records from the
back end fastcgi process. This includes switching to a poll based dispatch
loop that handles interleaved reads and writes.
* modules/proxy/mod_proxy_fcgi.c
(MAX_INPUT_BYTES): Removed, we now use AP_IOBUFSIZE.
(handle_headers): New helper function for parsing headers out of the
response data.
(send_stdin): Removed, code incorporated into dispatch routine.
(dispatch): New, poll based dispatch loop that handles both reads and
writes.
(fcgi_do_request): Call new dispatch routine. Return OK if we get
through without errors.
Re: [PATCH] mod_proxy_fcgi - add support for reading stdout from fcgi process
Posted by Garrett Rooney <ro...@electricjellyfish.net>.
On 12/27/05, Garrett Rooney <ro...@electricjellyfish.net> wrote:
> Comments, as always, are more than welcome.
As Paul pointed out on IRC, this patch fails to parse the HTTP headers
coming back from the back end fastcgi process. Here's an updated
version that fixes that. Log follows, patch attached.
-garrett
Add support for reading FCGI_STDOUT and FCGI_END_REQUEST records from the
back end fastcgi process. This includes switching to a poll based dispatch
loop that handles interleaved reads and writes.
* modules/proxy/mod_proxy_fcgi.c
(MAX_INPUT_BYTES): Removed, we now use AP_IOBUFSIZE.
(handle_headers): New helper function for parsing headers out of the
response data.
(send_stdin): Removed, code incorporated into dispatch routine.
(dispatch): New, poll based dispatch loop that handles both reads and
writes.
(fcgi_do_request): Call new dispatch routine. Return OK if we get
through without errors.