Bob Hutchison | 12 Mar 2005 15:33
Picon
Favicon

[Araneida] Using TBNL with Araneida

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 
:-) 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)))
(Continue reading)

Brian Mastenbrook | 12 Mar 2005 16:14
Picon
Picon
Favicon

Re: [Araneida] Using TBNL with Araneida


On Mar 12, 2005, at 8:33 AM, Bob Hutchison wrote:

> 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 :-) 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.

Very neat!

> I can provide a patch to Araneida 0.9 if somebody will tell me who to
> send it to.

You've found the right place. I'd be interested in having a look.
--
Brian Mastenbrook
chandler <at> unmutual.info
http://www.iscblog.info/


Gmane