[tbnl-devel] Re: New version 0.4.0
Bob Hutchison
hutch at recursive.ca
Tue Mar 15 12:56:35 UTC 2005
On Mar 15, 2005, at 7:39 AM, Edi Weitz wrote:
> On Tue, 15 Mar 2005 07:34:29 -0500, Bob Hutchison <hutch at recursive.ca>
> wrote:
>
>> I changed get-apache-command to (unroll the first iteration of the
>> loop and so) read the first line and check to see if it contains a
>> space. If the line came from mod_lisp it will not have a space in
>> it. If it has a space, we know it wasn't mod_lisp so assume that
>> we've got a direct HTTP request. When handling HTTP, call the
>> read-request-from-stream/tbnl function (just above
>> get-apache-command in modlisp.lisp). This sets up the new
>> araneida::*standard-araneida* special variable (to nil) and calls
>> araneida::read-request-from-stream/guts which is a new entry point
>> in Araneida that I added by breaking up the previous function
>> (read-request-from-stream). It then adds a couple of headers (url,
>> content-stream, and server-ip-port) that TBNL seems to want. It then
>> calls process-apache-command and returns.
>
> So this should basically work without Araneida being there at all,
> right? Or is Araneida involved in sending the reply back to the
> browser?
>
Other than it uses the daemon.lisp code from Araneida to parse headers
on the way in, it does not need Araneida. I had considered writing an
HTTP header parser specifically for TBNL but I thought that modifying
the daemon.lisp code would be quicker. It isn't hard writing HTTP
header parsers, you only have to watch for multi-line headers.
I had to modify TBNL to write HTTP headers on the way out in order to
make it work with Araneida as a front end. So, saying this explicitly,
TBNL is writing the HTTP response directly to the socket. (Though I
have not tested this with redirect or require-authorization -- I had
modified send-output and write-header-line to accomplish this).
I didn't do anything about logging for either the stand-alone or
with-araneida versions.
The next logical step is to write an HTTP header parser for TBNL (or
negotiate with the Araneida folks to use their code).
>
----
Bob Hutchison -- blogs at <http://www.recursive.ca/hutch/>
Recursive Design Inc. -- <http://www.recursive.ca/>
More information about the Tbnl-devel
mailing list