Your suggestion of "naked text" for the raw response sounds fine to me. (In
fact, I wonder if there's some clever way to get the app server to send the
response directly to the web server, bypassing the adapter altogether?)
I would also suggest eventually switching to something non-python-specific
(i.e. no marshalling or pickling) for the raw request as well, which will make
it easier to write a C CGI adapter in the future for extra speed.
Chuck Esterbrook wrote:
> As most of you know, for WebKit there is always an adapter that resides
> between the web server and the app server. It accepts raw requests in a CGI
> like format and sends them to the app server which eventually sends back a
> raw response to the adapter.
> (I use the term 'raw' to emphasize that these are not the request and
> response Python objects used inside the app server during the transaction's
> life cycle.)
> The current format for a raw response is a dictionary which gets mashalled
> over a socket (marshalling is a more primitive and faster form of
> pickling). As someone pointed out, the entire raw response has to be read
> by the adapter before it can be fed to the web server. For longer requests,
> it would be beneficial to be able to piece-meal the response.
> So we need a "naked text" format. I propose that the format just be the
> final response form: a series of headers separated by newlines followed by
> an extra newline and the content.
> Some adapters can just pass this through. Other adapters, like mod_python,
> may need to parse the header information. No matter what format we go with
> there is going to be some kind of parsing for adapters that want to
> "understand" the headers. I figure we might as well go with a format that
> can often be passed straight to the web server with no interpretation.
> Comments and questions are welcome before I proceed...
- Geoff Talvola