12 Mar 2005 15:33
[Araneida] Using TBNL with Araneida
Bob Hutchison <hutch <at> recursive.ca>
2005-03-12 14:33:18 GMT
2005-03-12 14:33:18 GMT
Hi, I have been developing an application using mod_lisp/TBNL and have been very happy with the combination. As the project progressed the desire for a stand-alone version of the application has become overwhelming(Continue reading)Since I've used Araneida for prototyping in the past and liked it, I thought that using Araneida with TBNL would be a nice combination. I've got this working. It consists of an in-the-end surprisingly simple handle-request-response method and a few relatively minor changes to both TBNL and Araneida. I've been in touch with Edi Weitz regarding the changes to TBNL and will send him a patch. Now I need to talk to the Araneida developers about the change to Araneida that I made. The difficulty was that Araneida and TBNL take slightly different approaches to handling the body of an HTTP request. Araneida parses the body immediately (and I *think* assumes form encoding) where TBNL takes a lazy approach (and deals with multipart encodings). What I did was to add a new slot to the Araneida request class that records the body-string sent to the function parse-body (in daemon.lisp). I can then, before invoking TBNL, do this kind of thing: (with-input-from-string (input (map 'string (lambda (c) (code-char c)) (request-unparsed-body request))) (with-open-stream (tbnl::*apache-stream* (MAKE-TWO-WAY-STREAM input (request-stream request)))
Since I've used Araneida for prototyping in the past and liked it,
I thought that using Araneida with TBNL would be a nice combination.
I've got this working. It consists of an in-the-end surprisingly simple
handle-request-response method and a few relatively minor changes to
both TBNL and Araneida. I've been in touch with Edi Weitz regarding the
changes to TBNL and will send him a patch. Now I need to talk to the
Araneida developers about the change to Araneida that I made.
The difficulty was that Araneida and TBNL take slightly different
approaches to handling the body of an HTTP request. Araneida parses the
body immediately (and I *think* assumes form encoding) where TBNL takes
a lazy approach (and deals with multipart encodings). What I did was to
add a new slot to the Araneida request class that records the
body-string sent to the function parse-body (in daemon.lisp). I can
then, before invoking TBNL, do this kind of thing:
(with-input-from-string (input (map 'string
(lambda (c) (code-char c))
(request-unparsed-body
request)))
(with-open-stream (tbnl::*apache-stream* (MAKE-TWO-WAY-STREAM
input
(request-stream request)))
RSS Feed