From stesch at no-spoon.de Tue Mar 1 15:03:37 2005
From: stesch at no-spoon.de (Stefan Scholl)
Date: Tue, 1 Mar 2005 16:03:37 +0100
Subject: [tbnl-devel] Handling HTTP errors
In-Reply-To: <20040731001011.GH4076@parsec.no-spoon.de>
References: <20040731001011.GH4076@parsec.no-spoon.de>
Message-ID: <20050301150337.GU29337@parsec.no-spoon.de>
Hi!
On 2004-07-31 02:10:11, Stefan Scholl wrote:
> Function send-output in modlisp.lisp handles the response for
> different return codes. E. g. there's a "The requested URL ~A was
> not found on this server." for the 404 (+http-not-found+).
>
> How about letting the user change this behavior?
>
> One could explain the error to the user. Maybe in another
> language.
>
> Or think of all the funny 404 games. Remember the SGI babies?
I've implemented a very easy solution for this:
[Special variable]
*http-error-handler*
This variable holds NIL or a function designator. The
function gets called with an error code other than +http-ok+
or +http-not-modified+ and can return the content of an error
page. Return NIL if the submitted error can't be handled.
(Note that the handler function can access the request and
reply data.)
Now my own error handler can see if it has something to say.
Checking error code and maybe some further data from the request.
Very KISS.
Patch attached.
Regards,
Stefan
-------------- next part --------------
diff -ru --exclude='*.fasl' --exclude='*~' tbnl-0.3.11/doc/index.html tbnl-0.3.11-stesch/doc/index.html
--- tbnl-0.3.11/doc/index.html 2005-03-01 15:46:11.746925000 +0100
+++ tbnl-0.3.11-stesch/doc/index.html 2005-03-01 15:56:07.729322000 +0100
@@ -223,6 +223,7 @@
http-token-p
*tmp-directory*
*save-raw-post-data-p*
+ *http-error-handler*
Debugging TBNL applications
@@ -1521,6 +1522,17 @@
saved and may be retrieved with RAW-POST-DATA
.
+
[Special variable]
+
*http-error-handler*
+
+
+This variable holds NIL
or a function designator. The function gets called with an error code
+other than +http-ok+
or +http-not-modified+
and can return the content of an
+error page. Return NIL
if the submitted error can't be handled.
+(Note that the handler function can access the request and reply data.)
+
+
If you want to debug your TBNL applications it is recommend that you start Apache (i.e. the httpd
binary) with the -X
command-line option. Then set *DEBUG-MODE*
to a true value and poke around in the listener. Good luck... :)
diff -ru --exclude='*.fasl' --exclude='*~' tbnl-0.3.11/modlisp.lisp tbnl-0.3.11-stesch/modlisp.lisp
--- tbnl-0.3.11/modlisp.lisp 2005-03-01 15:05:31.000000000 +0100
+++ tbnl-0.3.11-stesch/modlisp.lisp 2005-03-01 15:31:08.000000000 +0100
@@ -51,26 +51,30 @@
return-code +http-internal-server-error+
status-line (status-line return-code)))
(unless (member return-code `(,+http-ok+ ,+http-not-modified+))
- ;; handle common return codes other than 200
- (setf (content-type *reply*)
+ ;; Call error handler, if any. Should return nil if it can't handle the error.
+ (when *http-error-handler*
+ (setq content (funcall *http-error-handler* return-code)))
+ ;; handle common return codes other than 200, which weren't handled by the error handler.
+ (unless content
+ (setf (content-type *reply*)
"text/html; charset=iso-8859-1"
- content
+ content
(format nil "~D ~A~A
~A
~A / mod_lisp~A/~A / TBNL ~A (~A ~A) at ~A Port ~D"
return-code status-line status-line
(case return-code
((#.+http-internal-server-error+)
- content)
+ content)
((#.+http-moved-temporarily+ #.+http-moved-permanently+)
- (format nil "The document has moved here"
- (header-out "Location")))
+ (format nil "The document has moved here"
+ (header-out "Location")))
((#.+http-authorization-required+)
- "The server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials \(e.g., bad password), or your browser doesn't understand how to supply the credentials required.")
+ "The server could not verify that you are authorized to access the document requested. Either you supplied the wrong credentials \(e.g., bad password), or your browser doesn't understand how to supply the credentials required.")
((#.+http-forbidden+)
- (format nil "You don't have permission to access ~A on this server."
- (script-name)))
+ (format nil "You don't have permission to access ~A on this server."
+ (script-name)))
((#.+http-not-found+)
- (format nil "The requested URL ~A was not found on this server."
- (script-name))))
+ (format nil "The requested URL ~A was not found on this server."
+ (script-name))))
(or (header-in "server-baseversion") "Apache")
(or (header-in "modlisp-major-version") "")
(or (header-in "modlisp-version") "")
@@ -79,7 +83,7 @@
(lisp-implementation-type)
(lisp-implementation-version)
(host *request*)
- (server-port :request *request*))))
+ (server-port :request *request*)))))
;; start with status line
(write-header-line "Status" (format nil "~d ~a" return-code status-line))
;; if there's content write the corresponding headers
diff -ru --exclude='*.fasl' --exclude='*~' tbnl-0.3.11/packages.lisp tbnl-0.3.11-stesch/packages.lisp
--- tbnl-0.3.11/packages.lisp 2005-03-01 15:24:13.000000000 +0100
+++ tbnl-0.3.11-stesch/packages.lisp 2005-03-01 15:32:00.000000000 +0100
@@ -40,6 +40,7 @@
#:*error*
#:*default-content-type*
#:*default-handler*
+ #:*http-error-handler*
#:*default-log-level*
#:*dispatch-table*
#:*lisp-errors-log-level*
diff -ru --exclude='*.fasl' --exclude='*~' tbnl-0.3.11/specials.lisp tbnl-0.3.11-stesch/specials.lisp
--- tbnl-0.3.11/specials.lisp 2005-03-01 15:23:57.000000000 +0100
+++ tbnl-0.3.11-stesch/specials.lisp 2005-03-01 15:27:46.000000000 +0100
@@ -242,6 +242,9 @@
(defparameter *default-handler* 'default-handler
"The name of the function which is always returned by DEFAULT-DISPATCHER.")
+(defvar *http-error-handler* nil
+ "A list of error dispatch functions.")
+
(defparameter *default-log-level* nil
"The default log level for LOG-MESSAGE*")
From stesch at no-spoon.de Tue Mar 1 18:11:13 2005
From: stesch at no-spoon.de (Stefan Scholl)
Date: Tue, 1 Mar 2005 19:11:13 +0100
Subject: [tbnl-devel] Accessing match information for regex dispatchers?
Message-ID: <20050301181113.GV29337@parsec.no-spoon.de>
Hi!
Would it be bad style or a bad idea to extend
CREATE-REGEX-DISPATCHER (html.lisp) to hold the result of
CL-PPCRE:SCAN in variables you then DECLARE as SPECIAL so that
the called handler function can access the match information?
Something like *MATCH-START*, *MATCH-END*, *REG-STARTS*, and *REG-ENDS*
just visible for the handler.
Regards,
Stefan
From edi at agharta.de Tue Mar 1 22:30:15 2005
From: edi at agharta.de (Edi Weitz)
Date: Tue, 01 Mar 2005 23:30:15 +0100
Subject: [tbnl-devel] New version 0.3.12
Message-ID:
Changelog:
Version 0.3.12
2005-03-01
Added *HTTP-ERROR-HANDLER* (suggested and coded by Stefan Scholl)
Exported and documented *SESSION-MAX-TIME*
Download:
Cheers,
Edi.
From edi at agharta.de Tue Mar 1 22:32:23 2005
From: edi at agharta.de (Edi Weitz)
Date: Tue, 01 Mar 2005 23:32:23 +0100
Subject: [tbnl-devel] Accessing match information for regex dispatchers?
In-Reply-To: <20050301181113.GV29337@parsec.no-spoon.de> (Stefan Scholl's
message of "Tue, 1 Mar 2005 19:11:13 +0100")
References: <20050301181113.GV29337@parsec.no-spoon.de>
Message-ID:
Hi!
(And thanks for the error handler patch.)
On Tue, 1 Mar 2005 19:11:13 +0100, Stefan Scholl wrote:
> Would it be bad style or a bad idea to extend
> CREATE-REGEX-DISPATCHER (html.lisp) to hold the result of
> CL-PPCRE:SCAN in variables you then DECLARE as SPECIAL so that the
> called handler function can access the match information?
>
> Something like *MATCH-START*, *MATCH-END*, *REG-STARTS*, and
> *REG-ENDS* just visible for the handler.
I'm not sure if it's bad style but I wouldn't like it. Why would you
need it? The handler has access to the URL anyway.
Cheers,
Edi.
From stesch at no-spoon.de Wed Mar 2 01:57:39 2005
From: stesch at no-spoon.de (Stefan Scholl)
Date: Wed, 2 Mar 2005 02:57:39 +0100
Subject: [tbnl-devel] Accessing match information for regex dispatchers?
In-Reply-To:
References: <20050301181113.GV29337@parsec.no-spoon.de>
Message-ID: <20050302015739.GW29337@parsec.no-spoon.de>
Hi!
On 2005-03-01 23:32:23, Edi Weitz wrote:
> On Tue, 1 Mar 2005 19:11:13 +0100, Stefan Scholl wrote:
> > Would it be bad style or a bad idea to extend
> > CREATE-REGEX-DISPATCHER (html.lisp) to hold the result of
> > CL-PPCRE:SCAN in variables you then DECLARE as SPECIAL so that the
> > called handler function can access the match information?
> >
> > Something like *MATCH-START*, *MATCH-END*, *REG-STARTS*, and
> > *REG-ENDS* just visible for the handler.
>
> I'm not sure if it's bad style but I wouldn't like it. Why would you
> need it? The handler has access to the URL anyway.
It was the first time I used CREATE-REGEX-DISPATCHER and I had to
parse the URL in the handler with the same regex. It was just an
idea.
But I like CL-PPCRE:SCAN-TO-STRINGS more and it's clearer this
way, without the specials.
I've done some projects which used mod_rewrite. Typical rewrite
rules matched and parsed a URL giving the registers as parameters
to the "real" address. Maybe that's the reason for my first
impression using CREATE-REGEX-DISPATCHER.
Regards,
Stefan
From hutch at recursive.ca Thu Mar 3 15:10:07 2005
From: hutch at recursive.ca (Bob Hutchison)
Date: Thu, 3 Mar 2005 10:10:07 -0500
Subject: [tbnl-devel] Running TBNL Standalone
Message-ID: <444a4a8ac1ee0c50a96b64157024aad5@recursive.ca>
Hi,
Has anybody thought of how TBNL might be run without an apache server
or mod_lisp involved? Why? I've got an application that would normally
be run on a server, but it would be useful to have a standalone demo
version. Setting up apache is not the kind of skill I'd expect from the
end user of this particular application.
It seems to me that somehow getting Araneida talking to TBNL would be
one route -- fake mod_lisp in an Araneida handler or replace TBNL's
modlisp.lisp would be two possibilities.
I suppose aserve and cl-http are also possibilities, but I suspect that
Araneida has something more to gain from TBNL.
Cheers,
Bob
----
Bob Hutchison -- blogs at
Recursive Design Inc. --
From edi at agharta.de Thu Mar 3 15:24:49 2005
From: edi at agharta.de (Edi Weitz)
Date: Thu, 03 Mar 2005 16:24:49 +0100
Subject: [tbnl-devel] Running TBNL Standalone
In-Reply-To: <444a4a8ac1ee0c50a96b64157024aad5@recursive.ca> (Bob
Hutchison's message of "Thu, 3 Mar 2005 10:10:07 -0500")
References: <444a4a8ac1ee0c50a96b64157024aad5@recursive.ca>
Message-ID:
On Thu, 3 Mar 2005 10:10:07 -0500, Bob Hutchison wrote:
> Has anybody thought of how TBNL might be run without an apache
> server or mod_lisp involved? Why? I've got an application that would
> normally be run on a server, but it would be useful to have a
> standalone demo version. Setting up apache is not the kind of skill
> I'd expect from the end user of this particular application.
>
> It seems to me that somehow getting Araneida talking to TBNL would
> be one route -- fake mod_lisp in an Araneida handler or replace
> TBNL's modlisp.lisp would be two possibilities.
>
> I suppose aserve and cl-http are also possibilities, but I suspect
> that Araneida has something more to gain from TBNL.
Sounds like an interesting idea. I've never done this until now,
though.
Cheers,
Edi.
From stesch at no-spoon.de Thu Mar 3 15:26:43 2005
From: stesch at no-spoon.de (Stefan Scholl)
Date: Thu, 3 Mar 2005 16:26:43 +0100
Subject: [tbnl-devel] Running TBNL Standalone
In-Reply-To: <444a4a8ac1ee0c50a96b64157024aad5@recursive.ca>
References: <444a4a8ac1ee0c50a96b64157024aad5@recursive.ca>
Message-ID: <20050303152643.GB29337@parsec.no-spoon.de>
Hi!
On 2005-03-03 10:10:07, Bob Hutchison wrote:
> It seems to me that somehow getting Araneida talking to TBNL would be
> one route -- fake mod_lisp in an Araneida handler or replace TBNL's
> modlisp.lisp would be two possibilities.
And when you're at it: How about a FastCGI bridge? There are some
nice and new http servers out there, which support FastCGI.
Regards,
Stefan
From edi at agharta.de Thu Mar 3 15:38:14 2005
From: edi at agharta.de (Edi Weitz)
Date: Thu, 03 Mar 2005 16:38:14 +0100
Subject: [tbnl-devel] Running TBNL Standalone
In-Reply-To: <20050303152643.GB29337@parsec.no-spoon.de> (Stefan Scholl's
message of "Thu, 3 Mar 2005 16:26:43 +0100")
References: <444a4a8ac1ee0c50a96b64157024aad5@recursive.ca>
<20050303152643.GB29337@parsec.no-spoon.de>
Message-ID:
On Thu, 3 Mar 2005 16:26:43 +0100, Stefan Scholl wrote:
> And when you're at it: How about a FastCGI bridge? There are some
> nice and new http servers out there, which support FastCGI.
One would need to integrate this one
or write a new implementation-independent version.
From hutch at recursive.ca Thu Mar 3 15:49:11 2005
From: hutch at recursive.ca (Bob Hutchison)
Date: Thu, 3 Mar 2005 10:49:11 -0500
Subject: [tbnl-devel] Running TBNL Standalone
In-Reply-To:
References: <444a4a8ac1ee0c50a96b64157024aad5@recursive.ca>
Message-ID: <0a5a94a3a6cce9905bc06828026cbe88@recursive.ca>
On Mar 3, 2005, at 10:24 AM, Edi Weitz wrote:
> On Thu, 3 Mar 2005 10:10:07 -0500, Bob Hutchison
> wrote:
>
>> Has anybody thought of how TBNL might be run without an apache
>> server or mod_lisp involved? Why? I've got an application that would
>> normally be run on a server, but it would be useful to have a
>> standalone demo version. Setting up apache is not the kind of skill
>> I'd expect from the end user of this particular application.
>>
>> It seems to me that somehow getting Araneida talking to TBNL would
>> be one route -- fake mod_lisp in an Araneida handler or replace
>> TBNL's modlisp.lisp would be two possibilities.
>>
>> I suppose aserve and cl-http are also possibilities, but I suspect
>> that Araneida has something more to gain from TBNL.
>
> Sounds like an interesting idea. I've never done this until now,
> though.
I think this is worth pursuing -- the more I think about it the more
I'm convinced. I think Araneida might be the way to go because both
packages will benefit. I want to avoid any changes to either Araneida
or TBNL at least for the first pass at this, so I guess that an
Araneida handler with a socket connection between them is an easy way
to achieve this. The socket can be eliminated later. Going to have to
worry about concurrent requests too...
Now all I have to do is find the time.
Cheers,
Bob
>
> Cheers,
> Edi.
>
>
----
Bob Hutchison -- blogs at
Recursive Design Inc. --
From randomtalk at gmail.com Sat Mar 5 21:17:05 2005
From: randomtalk at gmail.com (Jason Wang)
Date: Sat, 5 Mar 2005 16:17:05 -0500
Subject: [tbnl-devel] a problem while installing..
In-Reply-To:
References: <939cf2005020104293e8e87a0@mail.gmail.com>
<939cf2005020510332acdcf62@mail.gmail.com>
<939cf2005020511251634c6e8@mail.gmail.com>
<939cf200502201428347bd04@mail.gmail.com>
<939cf200502201512289f568b@mail.gmail.com>
Message-ID: <939cf2005030513172b1ce8d2@mail.gmail.com>
hi, when i go to http://localhost/tbnl/test/test.lisp, i just get a
TBNL Default Page, is that wat i suppose to get? since when i look in
the source, i see alot of different stuff, wayy too complicated to be
generating that simple page :|.. am i missing something here?
--
www.programer.name - my own personal blog : )
From edi at agharta.de Sat Mar 5 21:30:22 2005
From: edi at agharta.de (Edi Weitz)
Date: Sat, 05 Mar 2005 22:30:22 +0100
Subject: [tbnl-devel] a problem while installing..
In-Reply-To: <939cf2005030513172b1ce8d2@mail.gmail.com> (Jason Wang's
message of "Sat, 5 Mar 2005 16:17:05 -0500")
References: <939cf2005020104293e8e87a0@mail.gmail.com>
<939cf2005020510332acdcf62@mail.gmail.com>
<939cf2005020511251634c6e8@mail.gmail.com>
<939cf200502201428347bd04@mail.gmail.com>
<939cf200502201512289f568b@mail.gmail.com>
<939cf2005030513172b1ce8d2@mail.gmail.com>
Message-ID:
Hi!
On Sat, 5 Mar 2005 16:17:05 -0500, Jason Wang wrote:
> hi, when i go to http://localhost/tbnl/test/test.lisp, i just get a
> TBNL Default Page, is that wat i suppose to get?
Depends on what you've been doing.
> since when i look in the source, i see alot of different stuff, wayy
> too complicated to be generating that simple page :|.. am i missing
> something here?
This looks as if you have done something like
(asdf:oos 'asdf:load-op :tbnl)
(tbnl:start-tbnl)
while you were supposed to do
(asdf:oos 'asdf:load-op :tbnl-test)
(tbnl:start-tbnl)
to see the test pages. Is that the case?
Cheers,
Edi.
From randomtalk at gmail.com Sun Mar 6 03:31:08 2005
From: randomtalk at gmail.com (Jason Wang)
Date: Sat, 5 Mar 2005 22:31:08 -0500
Subject: [tbnl-devel] a problem while installing..
In-Reply-To:
References: <939cf2005020104293e8e87a0@mail.gmail.com>
<939cf2005020511251634c6e8@mail.gmail.com>
<939cf200502201428347bd04@mail.gmail.com>
<939cf200502201512289f568b@mail.gmail.com>
<939cf2005030513172b1ce8d2@mail.gmail.com>
Message-ID: <939cf20050305193157483702@mail.gmail.com>
hi.... i looked through the test program, understand most of it :D
mmm.. however, i am still hopelessly lost when trying to write a
simple program, prob just my new experience with lisp, but, is there
any tutorials online that'll bring you through the construction of a
simple lisp web application?
i donno if allegroserve is almost the same as tbnl + apache, but i
read alot of stuff about it in Practical Common Lisp.. However, i
can't seem to get allegroserve to work for me..
i'm running the following packages for lisp web applications:
cl-base64-3.3.1
cl-ppcre-1.2.1
cl-who-0.4.4
kmrcl-1.78
md5-1.8.5
tbnl-0.3.10
url-rewrite
i've read about uncommon web, don't quite get what's good about it :|
and considers to use clsql for database (since i have been using mysql
for 2 years, thought wouldn't be too hard to transfer my knowledge..),
though reading Paul Graham's book, he said we should be just using
flat files to store infomation.. i've went on
multiple times, though i don't get what they are doing.. mmm.. you
told me to google for alternative ways of persisting data, though i
tried multiple terms, turned up with not much helpful results, terms
have tried "lisp web applications", "lisp + persist data", "lisp + web
+ data"... what terms do you suggest?
thanks alot for your help :D
--
www.programer.name - my own personal blog : )
From edi at agharta.de Sun Mar 6 08:26:48 2005
From: edi at agharta.de (Edi Weitz)
Date: Sun, 06 Mar 2005 09:26:48 +0100
Subject: [tbnl-devel] a problem while installing..
In-Reply-To: <939cf2005030517495f6bfbfa@mail.gmail.com> (Jason Wang's
message of "Sat, 5 Mar 2005 20:49:12 -0500")
References: <939cf2005020104293e8e87a0@mail.gmail.com>
<939cf2005020511251634c6e8@mail.gmail.com>
<939cf200502201428347bd04@mail.gmail.com>
<939cf200502201512289f568b@mail.gmail.com>
<939cf2005030513172b1ce8d2@mail.gmail.com>
<939cf2005030517495f6bfbfa@mail.gmail.com>
Message-ID:
On Sat, 5 Mar 2005 20:49:12 -0500, Jason Wang wrote:
> ahhh.. that is indeed wat's wrong.. so can you tell me what is going
> on?
It's all in the docs.
> why do i need to load :tbnl-test?
You only need to load it if you want to see the test website.
> since from my php experience whatever page you point to the server
> suppose to serve up? mmm.
Luckily this is not PHP but Lisp. (And, FWIW, you can also tweak PHP
not to do that.)
Edi.
From edi at agharta.de Sun Mar 6 08:40:40 2005
From: edi at agharta.de (Edi Weitz)
Date: Sun, 06 Mar 2005 09:40:40 +0100
Subject: [tbnl-devel] a problem while installing..
In-Reply-To: <939cf20050305193157483702@mail.gmail.com> (Jason Wang's
message of "Sat, 5 Mar 2005 22:31:08 -0500")
References: <939cf2005020104293e8e87a0@mail.gmail.com>
<939cf2005020511251634c6e8@mail.gmail.com>
<939cf200502201428347bd04@mail.gmail.com>
<939cf200502201512289f568b@mail.gmail.com>
<939cf2005030513172b1ce8d2@mail.gmail.com>
<939cf20050305193157483702@mail.gmail.com>
Message-ID:
On Sat, 5 Mar 2005 22:31:08 -0500, Jason Wang wrote:
> and considers to use clsql for database (since i have been using
> mysql for 2 years, thought wouldn't be too hard to transfer my
> knowledge..), though reading Paul Graham's book, he said we should
> be just using flat files to store infomation.. i've went on
> multiple times, though i don't get what they are
> doing.. mmm.. you told me to google for alternative ways of
> persisting data, though i tried multiple terms, turned up with not
> much helpful results, terms have tried "lisp web applications",
> "lisp + persist data", "lisp + web
> + data"... what terms do you suggest?
Non-SQL alternatives for persistent storage:
- Plob!
- cl-elephant
- bknr's persistent store
- cl-prevalence
- cl-store
- Paul Foley's interface to Berkeley DB
Cheers,
Edi.
From marc.battyani at fractalconcept.com Mon Mar 7 16:41:46 2005
From: marc.battyani at fractalconcept.com (Marc Battyani)
Date: Mon, 7 Mar 2005 17:41:46 +0100
Subject: [tbnl-devel] Running TBNL Standalone
References: <444a4a8ac1ee0c50a96b64157024aad5@recursive.ca>
<0a5a94a3a6cce9905bc06828026cbe88@recursive.ca>
Message-ID: <06e701c52334$8dfa7480$0a02a8c0@marcxp>
"Bob Hutchison" wrote:
> On Mar 3, 2005, at 10:24 AM, Edi Weitz wrote:
>
> > On Thu, 3 Mar 2005 10:10:07 -0500, Bob Hutchison
> > wrote:
> >
> >> Has anybody thought of how TBNL might be run without an apache
> >> server or mod_lisp involved? Why? I've got an application that would
> >> normally be run on a server, but it would be useful to have a
> >> standalone demo version. Setting up apache is not the kind of skill
> >> I'd expect from the end user of this particular application.
> >>
> >> It seems to me that somehow getting Araneida talking to TBNL would
> >> be one route -- fake mod_lisp in an Araneida handler or replace
> >> TBNL's modlisp.lisp would be two possibilities.
> >>
> >> I suppose aserve and cl-http are also possibilities, but I suspect
> >> that Araneida has something more to gain from TBNL.
> >
> > Sounds like an interesting idea. I've never done this until now,
> > though.
I've done this once with paserve. IIRC there was just very few lines to
write to call the normal mod_lisp handler function.
Marc
From hutch at recursive.ca Mon Mar 7 19:38:40 2005
From: hutch at recursive.ca (Bob Hutchison)
Date: Mon, 7 Mar 2005 14:38:40 -0500
Subject: [tbnl-devel] Running TBNL Standalone
In-Reply-To: <06e701c52334$8dfa7480$0a02a8c0@marcxp>
References: <444a4a8ac1ee0c50a96b64157024aad5@recursive.ca>
<0a5a94a3a6cce9905bc06828026cbe88@recursive.ca>
<06e701c52334$8dfa7480$0a02a8c0@marcxp>
Message-ID:
On Mar 7, 2005, at 11:41 AM, Marc Battyani wrote:
> "Bob Hutchison" wrote:
>> On Mar 3, 2005, at 10:24 AM, Edi Weitz wrote:
>>
>>> On Thu, 3 Mar 2005 10:10:07 -0500, Bob Hutchison
>>> wrote:
>>>
>>>> Has anybody thought of how TBNL might be run without an apache
>>>> server or mod_lisp involved? Why? I've got an application that would
>>>> normally be run on a server, but it would be useful to have a
>>>> standalone demo version. Setting up apache is not the kind of skill
>>>> I'd expect from the end user of this particular application.
>>>>
>>>> It seems to me that somehow getting Araneida talking to TBNL would
>>>> be one route -- fake mod_lisp in an Araneida handler or replace
>>>> TBNL's modlisp.lisp would be two possibilities.
>>>>
>>>> I suppose aserve and cl-http are also possibilities, but I suspect
>>>> that Araneida has something more to gain from TBNL.
>>>
>>> Sounds like an interesting idea. I've never done this until now,
>>> though.
>
> I've done this once with paserve. IIRC there was just very few lines to
> write to call the normal mod_lisp handler function.
You mean calling mod_lisp from the lisp server, presumably using an
FFI? Hadn't thought of that.
>
> Marc
>
>
>
----
Bob Hutchison -- blogs at
Recursive Design Inc. --
From marc.battyani at fractalconcept.com Mon Mar 7 20:15:30 2005
From: marc.battyani at fractalconcept.com (Marc Battyani)
Date: Mon, 7 Mar 2005 21:15:30 +0100
Subject: [tbnl-devel] Running TBNL Standalone
References: <444a4a8ac1ee0c50a96b64157024aad5@recursive.ca>
<0a5a94a3a6cce9905bc06828026cbe88@recursive.ca>
<06e701c52334$8dfa7480$0a02a8c0@marcxp>
Message-ID: <07b101c52352$6a0c2b40$0a02a8c0@marcxp>
"Bob Hutchison" wrote:
> On Mar 7, 2005, at 11:41 AM, Marc Battyani wrote:
>
> > I've done this once with paserve. IIRC there was just very few lines to
> > write to call the normal mod_lisp handler function.
>
> You mean calling mod_lisp from the lisp server, presumably using an
> FFI? Hadn't thought of that.
No, I mean calling the mod_lisp handler on the Lisp side. Generally it's the
#'process-apache-command or #'process-apache-request function.
Marc
From ocorrain at yahoo.com Tue Mar 8 12:35:32 2005
From: ocorrain at yahoo.com (=?iso-8859-1?Q?Tiarn=E1n_=D3_Corr=E1in?=)
Date: Tue, 08 Mar 2005 12:35:32 +0000
Subject: [tbnl-devel] Problem with file uploads
Message-ID:
Hi--
I'm using tbnl to run a site (educational in purpose), which will be
rich in texts and images. I want people with the appropriate
privileges to be able to upload images to the server, where various
incantations will be performed to ensure that the images are formatted
correctly for the site.
However, I seem to be running into a problem with either mod lisp or
tbnl, for images >=~1MB. When I try to upload an image of this site,
an internal server error is returned after a few seconds, and the
converted image (using imagemagick) appears in the thumbnail gallery
with a portion of the bottom shown in grey, as if the image did not
upload completely to the server.
Is there some configurable upper limit to the size of file uploads, or
can someone point me to the likely source of the problem?
regards
--
Tiarn?n
From marc.battyani at fractalconcept.com Tue Mar 8 12:57:57 2005
From: marc.battyani at fractalconcept.com (Marc Battyani)
Date: Tue, 8 Mar 2005 13:57:57 +0100
Subject: [tbnl-devel] Problem with file uploads
References:
Message-ID: <0a6101c523de$745cae30$0a02a8c0@marcxp>
"Tiarn?n ? Corr?in" wrote:
[...]
>However, I seem to be running into a problem with either mod lisp or
>tbnl, for images >=~1MB. When I try to upload an image of this site,
>an internal server error is returned after a few seconds, and the
>converted image (using imagemagick) appears in the thumbnail gallery
>with a portion of the bottom shown in grey, as if the image did not
>upload completely to the server.
>Is there some configurable upper limit to the size of file uploads, or
>can someone point me to the likely source of the problem?
What Lisp are you using ?
For instance in Lispworks the array-total-size-limit is very small: 1048448
so you can't have strings greater than that.
:-(
Marc
From ocorrain at yahoo.com Tue Mar 8 15:58:05 2005
From: ocorrain at yahoo.com (=?iso-8859-1?Q?Tiarn=E1n_=D3_Corr=E1in?=)
Date: Tue, 08 Mar 2005 15:58:05 +0000
Subject: [tbnl-devel] Problem with file uploads
In-Reply-To: <0a6101c523de$745cae30$0a02a8c0@marcxp> (Marc Battyani's message
of "Tue, 8 Mar 2005 13:57:57 +0100")
References:
<0a6101c523de$745cae30$0a02a8c0@marcxp>
Message-ID:
"Marc Battyani" writes:
> What Lisp are you using ?
OpenMCL on Mac OS X (for development), and CMUCL on FreeBSD
(deployment). Just checked, and CMUCL seems to be more forgiving, with
an array-total-size-limit of 536870911, as opposed to 16777216 in
OpenMCL.
Is there any way of getting around these limitations, perhaps by
rewriting the code that handles uploads? If so, could you point me in
the direction of what needs to change?
regards
Tiarn?n
From edi at agharta.de Tue Mar 8 16:45:11 2005
From: edi at agharta.de (Edi Weitz)
Date: Tue, 08 Mar 2005 17:45:11 +0100
Subject: [tbnl-devel] Problem with file uploads
In-Reply-To:
=?iso-8859-1?q?=28Tiarn=E1n_=D3=2E_Corr=E1in's?= message of "Tue,
08 Mar 2005 15:58:05 +0000")
References:
<0a6101c523de$745cae30$0a02a8c0@marcxp>
Message-ID:
On Tue, 08 Mar 2005 15:58:05 +0000, ocorrain at yahoo.com (Tiarn?n ? Corr?in) wrote:
> Is there any way of getting around these limitations, perhaps by
> rewriting the code that handles uploads? If so, could you point me
> in the direction of what needs to change?
I'm not aware of any limitations - I specifically rewrote Janis
Dzerins' to read from a stream and write to a stream.
FWIW, I just uploaded a 126MB MP3 file via TBNL/LispWorks (using the
upload test that comes with the distribution), downloaded it again,
and got a result which is identical to the original file according to
diff.
Cheers,
Edi.
From edi at agharta.de Tue Mar 8 16:55:51 2005
From: edi at agharta.de (Edi Weitz)
Date: Tue, 08 Mar 2005 17:55:51 +0100
Subject: [tbnl-devel] Problem with file uploads
In-Reply-To: (Edi Weitz's message of "Tue, 08 Mar
2005 17:45:11 +0100")
References:
<0a6101c523de$745cae30$0a02a8c0@marcxp>
Message-ID:
On Tue, 08 Mar 2005 17:45:11 +0100, Edi Weitz wrote:
> I'm not aware of any limitations - I specifically rewrote Janis
> Dzerins' to read from a stream and write to a stream.
^------- RFC 2388 code
From ocorrain at yahoo.com Tue Mar 8 17:35:19 2005
From: ocorrain at yahoo.com (=?iso-8859-1?Q?Tiarn=E1n_=D3_Corr=E1in?=)
Date: Tue, 08 Mar 2005 17:35:19 +0000
Subject: [tbnl-devel] Problem with file uploads
In-Reply-To: (Edi Weitz's message of "Tue, 08 Mar
2005 17:45:11 +0100")
References:
<0a6101c523de$745cae30$0a02a8c0@marcxp>
Message-ID:
Edi Weitz writes:
> On Tue, 08 Mar 2005 15:58:05 +0000, ocorrain at yahoo.com (Tiarn?n ? Corr?in) wrote:
>
>> Is there any way of getting around these limitations, perhaps by
>> rewriting the code that handles uploads? If so, could you point me
>> in the direction of what needs to change?
>
> I'm not aware of any limitations - I specifically rewrote Janis
> Dzerins' to read from a stream and write to a stream.
What version of tbnl? I'm using 0.3.11 at the mo, and am definitely
running into problems that seem to be related to
array-size-limit. I'll see if I can come up with a reproducible bug
report.
--
Tiarn?n
From edi at agharta.de Tue Mar 8 18:12:20 2005
From: edi at agharta.de (Edi Weitz)
Date: Tue, 08 Mar 2005 19:12:20 +0100
Subject: [tbnl-devel] Problem with file uploads
In-Reply-To:
=?iso-8859-1?q?=28Tiarn=E1n_=D3=2E_Corr=E1in's?= message of "Tue,
08 Mar 2005 17:35:19 +0000")
References:
<0a6101c523de$745cae30$0a02a8c0@marcxp>
Message-ID:
On Tue, 08 Mar 2005 17:35:19 +0000, ocorrain at yahoo.com (Tiarn?n ? Corr?in) wrote:
> What version of tbnl?
I tested with 0.3.12 and 0.3.10, both worked.
> I'm using 0.3.11 at the mo, and am definitely running into problems
> that seem to be related to array-size-limit.
Are you sure you have problems at file upload time and not when
delivering the uploaded file back to the user? Delivering large files
through TBNL won't work, of course, because all the content is sent to
mod_lisp at once. This is a deliberate design decision of TBNL.
If you want to serve large static files you can always bypass TBNL and
serve them directly through Apache.
> I'll see if I can come up with a reproducible bug report.
That would be nice.
Cheers,
Edi.
From ocorrain at yahoo.com Tue Mar 8 18:21:37 2005
From: ocorrain at yahoo.com (=?iso-8859-1?Q?Tiarn=E1n_=D3_Corr=E1in?=)
Date: Tue, 08 Mar 2005 18:21:37 +0000
Subject: [tbnl-devel] Problem with file uploads
In-Reply-To: (Edi Weitz's message of "Tue, 08 Mar
2005 19:12:20 +0100")
References:
<0a6101c523de$745cae30$0a02a8c0@marcxp>
Message-ID:
Edi Weitz writes:
> On Tue, 08 Mar 2005 17:35:19 +0000, ocorrain at yahoo.com (Tiarn?n ? Corr?in) wrote:
> I tested with 0.3.12 and 0.3.10, both worked.
I'll upgrade and see if it's still a problem.
> Are you sure you have problems at file upload time and not when
> delivering the uploaded file back to the user? Delivering large files
> through TBNL won't work, of course, because all the content is sent to
> mod_lisp at once. This is a deliberate design decision of TBNL.
Fair enough. I'm sure that it isn't a problem with serving the files,
since I do bypass TBNL for serving images.
The flow goes like this:
1. Upload file to server
2. File is changed using imagemagick to a sensible size
3. Thumbnail is produced.
4. User is given gallery of thumbnails
As I described earlier in the thread, the thumbnail/processed image is
grey at the bottom, leading me to believe that imagemagick is
processing an incomplete jpeg.
Is there any reason at all that array-max-size-limit would restrict
upload size?
--
Tiarn?n
From edi at agharta.de Tue Mar 8 19:32:16 2005
From: edi at agharta.de (Edi Weitz)
Date: Tue, 08 Mar 2005 20:32:16 +0100
Subject: [tbnl-devel] Problem with file uploads
In-Reply-To:
=?iso-8859-1?q?=28Tiarn=E1n_=D3=2E_Corr=E1in's?= message of "Tue,
08 Mar 2005 18:21:37 +0000")
References:
<0a6101c523de$745cae30$0a02a8c0@marcxp>
Message-ID:
On Tue, 08 Mar 2005 18:21:37 +0000, ocorrain at yahoo.com (Tiarn?n ? Corr?in) wrote:
> Is there any reason at all that array-max-size-limit would restrict
> upload size?
Not that I'm aware of at the moment. But it wouldn't be the first
time that my memory fails... :)
From tbnl at bignoli.it Fri Mar 11 21:03:10 2005
From: tbnl at bignoli.it (Aurelio Bignoli)
Date: Fri, 11 Mar 2005 22:03:10 +0100
Subject: [tbnl-devel] Problem with file uploads
In-Reply-To:
References:
Message-ID: <16946.1934.145593.201879@vav.19216810.loc>
Tiarn?n ? Corr?in writes:
> However, I seem to be running into a problem with either mod lisp or
> tbnl, for images >=~1MB. When I try to upload an image of this site,
> an internal server error is returned after a few seconds, and the
> converted image (using imagemagick) appears in the thumbnail gallery
> with a portion of the bottom shown in grey, as if the image did not
> upload completely to the server.
I had the same problem trying to upload a 23MB TIFF file to a
PIII/733MHz server running Linux, Apache 1.3 and CMUCL. The cause was
the "excessive" speed of Apache: the Lisp server is not so fast in
handling POST body, its socket buffer is filled up by mod_lisp, which
gets a write error and closes the connection.
To solve the problem, I added some declarations in rfc2388.lisp and
modified the inner loop to read the POST request body in chunks of
4096 byte, using the "Content-length" HTTP header. The result was a
25% increase in file transfer speed, I was able to handle about
3.8MB/sec.
Not bad, but not enough for data coming from a 100Mbit/sec LAN. So I
had also to "enlarge" the socket buffer with a call to the setsockopt
Unix system call.
If someone is interested, I could post my changes. With a caveat:
request body is read using READ-SEQUENCE; if the connection is closed
during transfer, the corresponding server thread hangs indefinitely.
Regards,
Aurelio
From hutch at recursive.ca Fri Mar 11 21:26:41 2005
From: hutch at recursive.ca (Bob Hutchison)
Date: Fri, 11 Mar 2005 16:26:41 -0500
Subject: [tbnl-devel] Running TBNL Standalone
In-Reply-To: <0a5a94a3a6cce9905bc06828026cbe88@recursive.ca>
References: <444a4a8ac1ee0c50a96b64157024aad5@recursive.ca>
<0a5a94a3a6cce9905bc06828026cbe88@recursive.ca>
Message-ID: <029013934a1766fccaa9a5a78bb0324a@recursive.ca>
On Mar 3, 2005, at 10:49 AM, Bob Hutchison wrote:
>
> On Mar 3, 2005, at 10:24 AM, Edi Weitz wrote:
>
>> On Thu, 3 Mar 2005 10:10:07 -0500, Bob Hutchison
>> wrote:
>>
>>> Has anybody thought of how TBNL might be run without an apache
>>> server or mod_lisp involved? Why? I've got an application that would
>>> normally be run on a server, but it would be useful to have a
>>> standalone demo version. Setting up apache is not the kind of skill
>>> I'd expect from the end user of this particular application.
>>>
>>> It seems to me that somehow getting Araneida talking to TBNL would
>>> be one route -- fake mod_lisp in an Araneida handler or replace
>>> TBNL's modlisp.lisp would be two possibilities.
>>>
>>> I suppose aserve and cl-http are also possibilities, but I suspect
>>> that Araneida has something more to gain from TBNL.
>>
>> Sounds like an interesting idea. I've never done this until now,
>> though.
>
> I think this is worth pursuing -- the more I think about it the more
> I'm convinced. I think Araneida might be the way to go because both
> packages will benefit. I want to avoid any changes to either Araneida
> or TBNL at least for the first pass at this, so I guess that an
> Araneida handler with a socket connection between them is an easy way
> to achieve this. The socket can be eliminated later. Going to have to
> worry about concurrent requests too...
>
> Now all I have to do is find the time.
>
I've found some time in the last couple of days and pretty much have
this working with Araneida (in LispWorks at least). I've got to track
down a few little problems but nothing much (e.g. a spurious 404 error
when using FireFox that doesn't happen with other browsers, and some
also spurious and intermittent socket errors).
While doing this I noticed something a little funny with the dates
associated with If-modified-since. TBNL (rfc-1123-date) produces dates
like "Tue, 1 Feb 2005 13:49:29 GMT" while Safari produces dates like
"Tue, 01 Feb 2005 13:49:29 GMT" -- same date but you can't compare them
as strings. If you look at rfc2616 section 3.3.1 there is an example
that has the leading 0 on the day of month. Safari produces a header
with the leading 0 for If-modified-since, so files in the first 9 days
of any month will never match. FireFox appears to return whatever you
send it, so it works there. I think this is probably a bug in TBNL.
This turned out to be fairly straight forward in the end -- I tried
several strategies and think I have a pretty simple one. Unfortunately
the question becomes what is Araneida adding to this other than
handling the request parsing.
It is *very* fast on my machine. I've appended part of the output from
the apache ab utility for the direct to Araneida and apache/mod_lisp
configurations (unfortunately, if I increase the concurrency level to
15 or more I get a lot of errors from Araneida). I don't have Araneida
operating as a proxy behind apache at the moment so I have no
benchmarks for that configuration (and this also means that I've not
tested it). A similar application in Java (that is being replace by
this CL version) can barely sustain 18 Kbytes/s (don't read too much
into that number, the Java application runs much better if it is
operating on something other than my notebook (Mac powerbook G4 1GHz 2G
RAM) -- of course so might the lisp application). And remember, this is
not a well conceived benchmark -- make of it what you will.
I'm going to download the most recent version of TBNL and integrate
changes into that. There are not many and perhaps I can avoid them all.
I'll get this cleaned up and then make it available.
Cheers,
Bob
Araneida (directly) -> TBNL -------------------------------------
Document Length: 4288 bytes
Concurrency Level: 10
Time taken for tests: 63.614 seconds
Complete requests: 5000
Failed requests: 0
Broken pipe errors: 0
Total transferred: 22415000 bytes
HTML transferred: 21440000 bytes
Requests per second: 78.60 [#/sec] (mean)
Time per request: 127.23 [ms] (mean)
Time per request: 12.72 [ms] (mean, across all concurrent
requests)
Transfer rate: 352.36 [Kbytes/sec] received
Connnection Times (ms)
min mean[+/-sd] median max
Connect: 0 17 218.8 0 3016
Processing: 10 109 42.7 100 365
Waiting: 9 109 42.7 100 365
Total: 10 127 221.6 101 3144
Percentage of the requests served within a certain time (ms)
50% 101
66% 119
75% 132
80% 141
90% 170
95% 198
98% 234
99% 282
100% 3144 (last request)
mod_lisp -> TBNL -------------------------------------
Document Length: 4288 bytes
Concurrency Level: 10
Time taken for tests: 96.451 seconds
Complete requests: 5000
Failed requests: 0
Broken pipe errors: 0
Total transferred: 22764006 bytes
HTML transferred: 21440000 bytes
Requests per second: 51.84 [#/sec] (mean)
Time per request: 192.90 [ms] (mean)
Time per request: 19.29 [ms] (mean, across all concurrent
requests)
Transfer rate: 236.02 [Kbytes/sec] received
Connnection Times (ms)
min mean[+/-sd] median max
Connect: 0 5 13.5 0 154
Processing: 8 187 222.2 107 2246
Waiting: 0 185 222.9 105 2245
Total: 8 192 221.5 115 2246
Percentage of the requests served within a certain time (ms)
50% 115
66% 180
75% 248
80% 291
90% 445
95% 614
98% 890
99% 1083
100% 2246 (last request)
From peter.barabas at gmail.com Fri Mar 11 21:30:59 2005
From: peter.barabas at gmail.com (Peter BARABAS)
Date: Fri, 11 Mar 2005 22:30:59 +0100
Subject: [tbnl-devel] Running TBNL Standalone
In-Reply-To: <029013934a1766fccaa9a5a78bb0324a@recursive.ca>
References: <444a4a8ac1ee0c50a96b64157024aad5@recursive.ca>
<0a5a94a3a6cce9905bc06828026cbe88@recursive.ca>
<029013934a1766fccaa9a5a78bb0324a@recursive.ca>
Message-ID: <4f2a8db5050311133053906eea@mail.gmail.com>
>
> I've found some time in the last couple of days and pretty much have
> this working with Araneida (in LispWorks at least). I've got to track
> down a few little problems but nothing much (e.g. a spurious 404 error
> when using FireFox that doesn't happen with other browsers, and some
> also spurious and intermittent socket errors).
The 404s are probably caused by Firefox wanting to leech "favicon.ico".
Regards,
Peter.
--
((call/cc call/cc) (call/cc call/cc))
From edi at agharta.de Sat Mar 12 08:48:04 2005
From: edi at agharta.de (Edi Weitz)
Date: Sat, 12 Mar 2005 09:48:04 +0100
Subject: [tbnl-devel] Problem with file uploads
In-Reply-To: <16946.1934.145593.201879@vav.19216810.loc> (Aurelio Bignoli's
message of "Fri, 11 Mar 2005 22:03:10 +0100")
References:
<16946.1934.145593.201879@vav.19216810.loc>
Message-ID:
On Fri, 11 Mar 2005 22:03:10 +0100, Aurelio Bignoli wrote:
> I had the same problem trying to upload a 23MB TIFF file to a
> PIII/733MHz server running Linux, Apache 1.3 and CMUCL. The cause
> was the "excessive" speed of Apache: the Lisp server is not so fast
> in handling POST body, its socket buffer is filled up by mod_lisp,
> which gets a write error and closes the connection.
I wonder why I haven't seen this when I tested with large (>100MB)
files on my machine - see previous posting. I tested with server and
client on the same machine so the speed should have been high enough.
My combination was LW/WinXP/Apache2 so your results /might/ show
problems specific to CMUCL or to Linux or to Apache 1.x...
Cheers,
Edi.
From edi at agharta.de Sat Mar 12 08:50:33 2005
From: edi at agharta.de (Edi Weitz)
Date: Sat, 12 Mar 2005 09:50:33 +0100
Subject: [tbnl-devel] Running TBNL Standalone
In-Reply-To: <029013934a1766fccaa9a5a78bb0324a@recursive.ca> (Bob
Hutchison's message of "Fri, 11 Mar 2005 16:26:41 -0500")
References: <444a4a8ac1ee0c50a96b64157024aad5@recursive.ca>
<0a5a94a3a6cce9905bc06828026cbe88@recursive.ca>
<029013934a1766fccaa9a5a78bb0324a@recursive.ca>
Message-ID:
On Fri, 11 Mar 2005 16:26:41 -0500, Bob Hutchison wrote:
> While doing this I noticed something a little funny with the dates
> associated with If-modified-since. TBNL (rfc-1123-date) produces
> dates like "Tue, 1 Feb 2005 13:49:29 GMT" while Safari produces
> dates like "Tue, 01 Feb 2005 13:49:29 GMT" -- same date but you
> can't compare them as strings. If you look at rfc2616 section 3.3.1
> there is an example that has the leading 0 on the day of
> month. Safari produces a header with the leading 0 for
> If-modified-since, so files in the first 9 days of any month will
> never match. FireFox appears to return whatever you send it, so it
> works there. I think this is probably a bug in TBNL.
Thanks, I'll look into this if I find some time. Or maybe Stefan
will... :)
> I'm going to download the most recent version of TBNL and integrate
> changes into that. There are not many and perhaps I can avoid them
> all. I'll get this cleaned up and then make it available.
Thanks. If you send patches it'd be very nice if you could also add a
section to the docs which explains how to set up TBNL with Araneida.
Cheers,
Edi.
From stesch at no-spoon.de Sat Mar 12 18:34:54 2005
From: stesch at no-spoon.de (Stefan Scholl)
Date: Sat, 12 Mar 2005 19:34:54 +0100
Subject: [tbnl-devel] mod_negotiation and wrong Last-Modified
Message-ID: <1434owv9kgang.dlg@parsec.no-spoon.de>
[That's what I've sent to gmane.comp.apache.user today.]
Hi!
I use Apache 1.3.33 (Gentoo) under Linux 2.6 together with mod_lisp
2.42. mod_lisp is a simple handler which communicates with running
Lisp images.
This is what I've found today:
When setting "Last-Modified" (the handler correctly calls
ap_parseHTTPdate(), ap_update_mtime(), and ap_set_last_modified())
the resulting response header has an other date in the
"Last-Modified" field. It is the mtime of the DocumentRoot. But only
if the mtime of DocumentRoot is _newer_ than the date you want to
set.
There's no "Last-Modified" in the response header when you don't set
it yourself.
ap_update_mtime() only updates r->mtime when the supplied time is
_newer_. So I've guessed that some other handler sets r->mtime to
the DocumentRoot.
I've found mod_negotiation. After removing it from the server config
the response header had the correct "Last-Modified" date.
2 possible workarounds:
1.) touch the DocumentRoot to an older date
2.) remove mod_negotiation
Regards,
Stefan
--
Web: http://www.no-spoon.de/ -*- IRC: stesch @ freenode
From edi at agharta.de Sat Mar 12 20:42:21 2005
From: edi at agharta.de (Edi Weitz)
Date: Sat, 12 Mar 2005 21:42:21 +0100
Subject: New version 0.3.13 (Was: [tbnl-devel] Running TBNL Standalone)
In-Reply-To: <029013934a1766fccaa9a5a78bb0324a@recursive.ca> (Bob
Hutchison's message of "Fri, 11 Mar 2005 16:26:41 -0500")
References: <444a4a8ac1ee0c50a96b64157024aad5@recursive.ca>
<0a5a94a3a6cce9905bc06828026cbe88@recursive.ca>
<029013934a1766fccaa9a5a78bb0324a@recursive.ca>
Message-ID:
On Fri, 11 Mar 2005 16:26:41 -0500, Bob Hutchison wrote:
> While doing this I noticed something a little funny with the dates
> associated with If-modified-since. TBNL (rfc-1123-date) produces
> dates like "Tue, 1 Feb 2005 13:49:29 GMT" while Safari produces
> dates like "Tue, 01 Feb 2005 13:49:29 GMT" -- same date but you
> can't compare them as strings. If you look at rfc2616 section 3.3.1
> there is an example that has the leading 0 on the day of
> month. Safari produces a header with the leading 0 for
> If-modified-since, so files in the first 9 days of any month will
> never match. FireFox appears to return whatever you send it, so it
> works there. I think this is probably a bug in TBNL.
Thanks for the info, I've uploaded a new version (0.3.13) which fixes
this.
Stefan Scholl provided some additional info which I'll include here:
1. This bug didn't show up before because Apache silently parses and
rewrites this header. Only because you sent it through Araneida
which obviously just lets it through could you see the wrong
format.
2. While Safari's behaviour is not strictly wrong it doesn't follow
the recommendation given in the RFC to send the header back exactly
as received from the server.
Thanks again,
Edi.
From hutch at recursive.ca Sun Mar 13 15:06:15 2005
From: hutch at recursive.ca (Bob Hutchison)
Date: Sun, 13 Mar 2005 10:06:15 -0500
Subject: [tbnl-devel] Running TBNL Standalone
In-Reply-To: <4f2a8db5050311133053906eea@mail.gmail.com>
References: <444a4a8ac1ee0c50a96b64157024aad5@recursive.ca>
<0a5a94a3a6cce9905bc06828026cbe88@recursive.ca>
<029013934a1766fccaa9a5a78bb0324a@recursive.ca>
<4f2a8db5050311133053906eea@mail.gmail.com>
Message-ID:
Could be. I'll check into that.
On Mar 11, 2005, at 4:30 PM, Peter BARABAS wrote:
>>
>> I've found some time in the last couple of days and pretty much have
>> this working with Araneida (in LispWorks at least). I've got to track
>> down a few little problems but nothing much (e.g. a spurious 404 error
>> when using FireFox that doesn't happen with other browsers, and some
>> also spurious and intermittent socket errors).
>
> The 404s are probably caused by Firefox wanting to leech "favicon.ico".
>
> Regards,
> Peter.
>
> --
> ((call/cc call/cc) (call/cc call/cc))
> _______________________________________________
> tbnl-devel site list
> tbnl-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/tbnl-devel
>
>
----
Bob Hutchison -- blogs at
Recursive Design Inc. --
From hutch at recursive.ca Sun Mar 13 15:32:44 2005
From: hutch at recursive.ca (Bob Hutchison)
Date: Sun, 13 Mar 2005 10:32:44 -0500
Subject: [tbnl-devel] Running TBNL Standalone
In-Reply-To:
References: <444a4a8ac1ee0c50a96b64157024aad5@recursive.ca>
<0a5a94a3a6cce9905bc06828026cbe88@recursive.ca>
<029013934a1766fccaa9a5a78bb0324a@recursive.ca>
Message-ID: <6d902ac640d45bac33a79693abb282b3@recursive.ca>
On Mar 12, 2005, at 3:50 AM, Edi Weitz wrote:
>
>> I'm going to download the most recent version of TBNL and integrate
>> changes into that. There are not many and perhaps I can avoid them
>> all. I'll get this cleaned up and then make it available.
>
> Thanks. If you send patches it'd be very nice if you could also add a
> section to the docs which explains how to set up TBNL with Araneida.
>
So. I was thinking. What if somebody didn't want to use Araneida, just
TBNL?
It turns out that with a relatively straight forward re-organisation of
Araneida's daemon.lisp code that *simultaneous* support for:
* browser->apache->mod_lisp->tbnl
* browser->apache->araneida
* browser->apache->araneida->tbnl
* browser->araneida
* browser->araneida->tbnl
* browser->tbnl
are all possible if you get your port numbers right.
There's a little problem though. The browser->tbnl support isn't
behaving properly. It serves the pages fine, but the memory use is
growing monotonically. Something is not being released. I'm not sure
what. Maybe the socket isn't closed? The number of processes remains
small (actually only one in TBNL, a few in aranedia).
Any ideas? If not, I'll try to work out what is happening. I may post
the patches with this problem still there.
I have a small test of the setup. I'll include that in the test
directory (I still have to clean it up a bit).
I'll try to post the patches to TBNL and Araneida later today.
Cheers,
Bob
----
Bob Hutchison -- blogs at
Recursive Design Inc. --
From ocorrain at yahoo.com Sun Mar 13 16:35:55 2005
From: ocorrain at yahoo.com (=?iso-8859-1?Q?Tiarn=E1n_=D3_Corr=E1in?=)
Date: Sun, 13 Mar 2005 16:35:55 +0000
Subject: [tbnl-devel] Problem with file uploads
In-Reply-To: (Edi Weitz's message of "Sat, 12 Mar
2005 09:48:04 +0100")
References:
<16946.1934.145593.201879@vav.19216810.loc>
Message-ID:
Edi Weitz writes:
> On Fri, 11 Mar 2005 22:03:10 +0100, Aurelio Bignoli wrote:
>
>> I had the same problem trying to upload a 23MB TIFF file to a
>> PIII/733MHz server running Linux, Apache 1.3 and CMUCL. The cause
>> was the "excessive" speed of Apache: the Lisp server is not so fast
>> in handling POST body, its socket buffer is filled up by mod_lisp,
>> which gets a write error and closes the connection.
>
> My combination was LW/WinXP/Apache2 so your results /might/ show
> problems specific to CMUCL or to Linux or to Apache 1.x...
I have the problem (or a similar one) with OpenMCL/MacOSX/Apache
1.3.31. Haven't experienced it yet on the server, which runs
CMUCL/FreeBSD/Apache 1.3.31
--
Tiarn?n
From stesch at no-spoon.de Sun Mar 13 18:31:16 2005
From: stesch at no-spoon.de (Stefan Scholl)
Date: Sun, 13 Mar 2005 19:31:16 +0100
Subject: [tbnl-devel] arbitrary per-request data?
In-Reply-To:
References: <20050214135640.GI18781@xach.com>
Message-ID: <20050313183116.GE28782@parsec.no-spoon.de>
On 2005-02-14 15:16:42, Edi Weitz wrote:
> On Mon, 14 Feb 2005 08:56:40 -0500, Zach Beane wrote:
> > But it occurred to me that there is already the *request*
> > structure. Would it make sense to be able to have a table of
> > arbitrary keys and values in the request structure for application
> > use? I was thinking of an accessor like this:
>
> I'm wondering if what you really want isn't just per-session info. If
> in your CURRENT-USER function you replace REQUEST-DATA with
> SESSION-VALUE isn't that the info you'd like to have? You'd get the
> sessions for free.
I'm sitting at a similar problem. One function is called two
times and has to read some data. It would be nice if I could
cache this data for one request so it only has to be read one
time.
Can't use a closure because AFAIK one request doesn't always
start a new process and the data could be too old in further
requests.
I don't want to start a session at this time.
Or maby just two variables in a closure. One holds the data and
the other *REQUEST*. Then I check against *REQUEST* with EQ and I
know if the stored data is from an old request or the current
one. Am I right?
Regards,
Stefan
From edi at agharta.de Sun Mar 13 21:37:53 2005
From: edi at agharta.de (Edi Weitz)
Date: Sun, 13 Mar 2005 22:37:53 +0100
Subject: [tbnl-devel] arbitrary per-request data?
In-Reply-To: <20050313183116.GE28782@parsec.no-spoon.de> (Stefan Scholl's
message of "Sun, 13 Mar 2005 19:31:16 +0100")
References: <20050214135640.GI18781@xach.com>
<20050313183116.GE28782@parsec.no-spoon.de>
Message-ID:
On Sun, 13 Mar 2005 19:31:16 +0100, Stefan Scholl wrote:
> I don't want to start a session at this time.
Why not?
> Or maby just two variables in a closure. One holds the data and the
> other *REQUEST*. Then I check against *REQUEST* with EQ and I know
> if the stored data is from an old request or the current one. Am I
> right?
Sounds reasonable.
Cheers,
Edi.
From edi at agharta.de Mon Mar 14 08:57:44 2005
From: edi at agharta.de (Edi Weitz)
Date: Mon, 14 Mar 2005 09:57:44 +0100
Subject: [tbnl-devel] Running TBNL Standalone
In-Reply-To: <6d902ac640d45bac33a79693abb282b3@recursive.ca> (Bob
Hutchison's message of "Sun, 13 Mar 2005 10:32:44 -0500")
References: <444a4a8ac1ee0c50a96b64157024aad5@recursive.ca>
<0a5a94a3a6cce9905bc06828026cbe88@recursive.ca>
<029013934a1766fccaa9a5a78bb0324a@recursive.ca>
<6d902ac640d45bac33a79693abb282b3@recursive.ca>
Message-ID:
On Sun, 13 Mar 2005 10:32:44 -0500, Bob Hutchison wrote:
> It turns out that with a relatively straight forward re-organisation
> of Araneida's daemon.lisp code that *simultaneous* support for:
>
> * browser->apache->mod_lisp->tbnl
> * browser->apache->araneida
> * browser->apache->araneida->tbnl
> * browser->araneida
> * browser->araneida->tbnl
> * browser->tbnl
>
> are all possible if you get your port numbers right.
Huh? browser->tbnl? How does that work? Who does the http part?
Cheers,
Edi.
From hutch at recursive.ca Mon Mar 14 13:22:00 2005
From: hutch at recursive.ca (Bob Hutchison)
Date: Mon, 14 Mar 2005 08:22:00 -0500
Subject: [tbnl-devel] Patches and example for running TBNL and Araneida
together
Message-ID:
Hi,
I've attached patches for both Araneida and TBNL to this message. Sorry
for the cross-posting but there is some co-ordination required here and
I thought this would be a good way to do it.
I've included this message the text from a README file that is part of
the tgz file I've attached.
Unfortunately there is a really *nasty* bug with the browser->tbnl
connection -- it consumes about 250k of memory for every access. I
cannot see the problem, and I'm looking for help :-)
It appears to be completely stable for browser->araneida->tbnl (tested
for 100's of thousands of hits).
I don't know how the tbnl-araneida package with the example should be
distributed.
I'm sure this description is too brief, I'll answer what questions I
can.
I hope you find this useful.
Cheers,
Bob
--------
Some changes have been made to allow TBNL to be used with Araneida. In
particular, it is now possible to use Araneida as a server to TBNL
handlers
and it is possible to send HTTP requests directly to the TBNL socket (in
effect by-passing Araneida).
This means that the following connections are possible *simultaneously*
browser->apache->araneida
browser->apache->araneida->tbnl (NEW)
browser->apache->mod_lisp->tbnl
browser->araneida
browser->araneida->tbnl (NEW)
browser->tbnl (NEW)
There is a package, tbnl-araneida, that shows how this works.
In Summary...
To connect directly to TBNL, all that is required is that araneida is
compiled
and loaded *before* tbnl is compiled and loaded. (There is conditionally
compiled code in TBNL).
To connect to TBNL through Araneida, use the the Araneida handler --
tbnl-araneida-handler -- provided for this purpose.
Note that in both cases the TBNL *dispatch-table* must be set up as you
normally would when using TBNL. The sense of the installed Araneida
handler
changes slightly to a url prefix mapper to TBNL (which further refines
the
request using the *dispatch-table*).
--------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tbnl-araneida.tgz
Type: application/x-gzip
Size: 7959 bytes
Desc: not available
URL:
-------------- next part --------------
----
Bob Hutchison -- blogs at
Recursive Design Inc. --
From hutch at recursive.ca Mon Mar 14 13:25:28 2005
From: hutch at recursive.ca (Bob Hutchison)
Date: Mon, 14 Mar 2005 08:25:28 -0500
Subject: [tbnl-devel] Running TBNL Standalone
In-Reply-To:
References: <444a4a8ac1ee0c50a96b64157024aad5@recursive.ca>
<0a5a94a3a6cce9905bc06828026cbe88@recursive.ca>
<029013934a1766fccaa9a5a78bb0324a@recursive.ca>
<6d902ac640d45bac33a79693abb282b3@recursive.ca>
Message-ID:
On Mar 14, 2005, at 3:57 AM, Edi Weitz wrote:
> On Sun, 13 Mar 2005 10:32:44 -0500, Bob Hutchison
> wrote:
>
>> It turns out that with a relatively straight forward re-organisation
>> of Araneida's daemon.lisp code that *simultaneous* support for:
>>
>> * browser->apache->mod_lisp->tbnl
>> * browser->apache->araneida
>> * browser->apache->araneida->tbnl
>> * browser->araneida
>> * browser->araneida->tbnl
>> * browser->tbnl
>>
>> are all possible if you get your port numbers right.
>
> Huh? browser->tbnl? How does that work? Who does the http part?
I hacked, er, enhanced, yes, that's it, enhanced, Araneida's
daemon.lisp to open it up a bit so that TBNL can use it's header
parsing stuff. When the first line received to TBNL has a space in it
the assumption is made that this is a direct HTTP request, otherwise a
mod_lisp request.
Cheers,
Bob
>
> Cheers,
> Edi.
>
>
----
Bob Hutchison -- blogs at
Recursive Design Inc. --
From edi at agharta.de Mon Mar 14 21:50:57 2005
From: edi at agharta.de (Edi Weitz)
Date: Mon, 14 Mar 2005 22:50:57 +0100
Subject: [tbnl-devel] New version 0.4.0 (Was: Patches and example for
running TBNL and Araneida together)
In-Reply-To: (Bob
Hutchison's message of "Mon, 14 Mar 2005 08:22:00 -0500")
References:
Message-ID:
Hi!
On Mon, 14 Mar 2005 08:22:00 -0500, Bob Hutchison wrote:
> I've attached patches for both Araneida and TBNL to this
> message. Sorry for the cross-posting but there is some co-ordination
> required here and I thought this would be a good way to do it.
Thanks. I've released a new version of TBNL (0.4.0) which includes
your patches and some initial documentation on how to use it - please
check.
It worked for me with LispWorks and AllegroCL but I get an error with
CMUCL:
No matching method for the generic function
#,
when called with arguments
(#).
[Condition of type PCL::NO-APPLICABLE-METHOD-ERROR]
> Unfortunately there is a really *nasty* bug with the browser->tbnl
> connection -- it consumes about 250k of memory for every access. I
> cannot see the problem, and I'm looking for help :-)
How does one test the browser->tbnl part?
> I don't know how the tbnl-araneida package with the example should
> be distributed.
I've modified it and added it to the TBNL distribution. It'll now
basically show the same pages the Apache/mod_lisp demo shows. Hope
that's OK for you.
Thanks again,
Edi.
From tbnl at bignoli.it Mon Mar 14 16:35:56 2005
From: tbnl at bignoli.it (Aurelio Bignoli)
Date: Mon, 14 Mar 2005 17:35:56 +0100
Subject: [tbnl-devel] Problem with file uploads
In-Reply-To:
References:
<16946.1934.145593.201879@vav.19216810.loc>
Message-ID: <16949.48492.511634.882875@vav.19216810.loc>
Edi Weitz writes:
> My combination was LW/WinXP/Apache2 so your results /might/ show
> problems specific to CMUCL or to Linux or to Apache 1.x...
well, I tried also with LWL Personal and the result was the same. If I
have time I'll install Apache 2 and I'll give it a try.
Regards,
Aurelio
From ignas.mikalajunas at gmail.com Tue Mar 15 00:12:13 2005
From: ignas.mikalajunas at gmail.com (Ignas Mikalajunas)
Date: Tue, 15 Mar 2005 02:12:13 +0200
Subject: [tbnl-devel] Problem with file uploads
In-Reply-To: <16949.48492.511634.882875@vav.19216810.loc>
References:
<16946.1934.145593.201879@vav.19216810.loc>
<16949.48492.511634.882875@vav.19216810.loc>
Message-ID:
Just started newest tbnl 0.4 and uploaded 180mb file. Yet the name of
the file is "[en] Shrek 3D [2004].avi" so i am geting
"http://localhost/tbnl/test/files/%5Ben%5D+Shrek+3D+%5B2004%5D.avi?path=%2Ftmp%2Ftbnl%2Ftest%2Ftbnl-test-1"
as a download link which leads to an error when trying to download it ...
Error in function LISP::FD-STREAM-READ-N-BYTES:
Error reading #: Bad address
though the file in that place exists ...
The backtrace is attached in a file.
Ignas Mikalaj?nas
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
From hutch at recursive.ca Tue Mar 15 00:30:48 2005
From: hutch at recursive.ca (Bob Hutchison)
Date: Mon, 14 Mar 2005 19:30:48 -0500
Subject: [tbnl-devel] Re: New version 0.4.0 (Was: Patches and example for
running TBNL and Araneida together)
In-Reply-To:
References:
Message-ID: <99f74eac2d1e5e90e834b99366001ada@recursive.ca>
On Mar 14, 2005, at 4:50 PM, Edi Weitz wrote:
> Hi!
>
> On Mon, 14 Mar 2005 08:22:00 -0500, Bob Hutchison
> wrote:
>
>> I've attached patches for both Araneida and TBNL to this
>> message. Sorry for the cross-posting but there is some co-ordination
>> required here and I thought this would be a good way to do it.
>
> Thanks. I've released a new version of TBNL (0.4.0) which includes
> your patches and some initial documentation on how to use it - please
> check.
I've downloaded it and installed. Encountered a little problem. In
araneida-test it seems that the setq of the *dispatch-table* has to be
a top level form the way the path to the fz.jpg file is written. If you
move it out of the setup code and onto the top level then compile and
load (in Lispworks) it will work... at least for me.
>
> It worked for me with LispWorks and AllegroCL but I get an error with
> CMUCL:
>
> No matching method for the generic function
> # {5964F471}>,
> when called with arguments
> (#).
> [Condition of type PCL::NO-APPLICABLE-METHOD-ERROR]
I think I might know what this is. I can't run CMUCL but I'll have a
look.
>
>> Unfortunately there is a really *nasty* bug with the browser->tbnl
>> connection -- it consumes about 250k of memory for every access. I
>> cannot see the problem, and I'm looking for help :-)
>
> How does one test the browser->tbnl part?
Hit port 3000 from your browser, for example
in my setup. You have to apply
the patches to Araneida 0.9 of course, and *make* *sure* you recompile
and use ASDF to load it.
>
>> I don't know how the tbnl-araneida package with the example should
>> be distributed.
>
> I've modified it and added it to the TBNL distribution. It'll now
> basically show the same pages the Apache/mod_lisp demo shows. Hope
> that's OK for you.
Fine by me. Thanks for doing this so quickly.
Cheers,
Bob
>
> Thanks again,
> Edi.
>
>
----
Bob Hutchison -- blogs at
Recursive Design Inc. --
From edi at agharta.de Tue Mar 15 01:36:58 2005
From: edi at agharta.de (Edi Weitz)
Date: Tue, 15 Mar 2005 02:36:58 +0100
Subject: [tbnl-devel] Re: New version 0.4.0
In-Reply-To: <99f74eac2d1e5e90e834b99366001ada@recursive.ca> (Bob
Hutchison's message of "Mon, 14 Mar 2005 19:30:48 -0500")
References:
<99f74eac2d1e5e90e834b99366001ada@recursive.ca>
Message-ID:
On Mon, 14 Mar 2005 19:30:48 -0500, Bob Hutchison wrote:
> Encountered a little problem. In araneida-test it seems that the
> setq of the *dispatch-table* has to be a top level form the way the
> path to the fz.jpg file is written. If you move it out of the setup
> code and onto the top level then compile and load (in Lispworks) it
> will work... at least for me.
Hmm, that should be irrelevant as I had the SETQ disabled with #+(or).
The *DISPATCH-TABLE* is supposed to be set by the top-level form in
test.lisp. You did load the test as described here
,
didn't you?
Cheers,
Edi.
From edi at agharta.de Tue Mar 15 01:53:44 2005
From: edi at agharta.de (Edi Weitz)
Date: Tue, 15 Mar 2005 02:53:44 +0100
Subject: [tbnl-devel] Problem with file uploads
In-Reply-To: (Ignas
Mikalajunas's message of "Tue, 15 Mar 2005 02:12:13 +0200")
References:
<16946.1934.145593.201879@vav.19216810.loc>
<16949.48492.511634.882875@vav.19216810.loc>
Message-ID:
On Tue, 15 Mar 2005 02:12:13 +0200, Ignas Mikalajunas wrote:
> Just started newest tbnl 0.4 and uploaded 180mb file. Yet the name
> of the file is "[en] Shrek 3D [2004].avi" so i am geting
> "http://localhost/tbnl/test/files/%5Ben%5D+Shrek+3D+%5B2004%5D.avi?path=%2Ftmp%2Ftbnl%2Ftest%2Ftbnl-test-1"
> as a download link which leads to an error when trying to download
> it ...
>
> Error in function LISP::FD-STREAM-READ-N-BYTES:
> Error reading #: Bad address
>
> though the file in that place exists ...
>
> The backtrace is attached in a file.
You didn't say which Lisp and OS you were using but I guess it's
CMUCL, right?
I don't think the name of the file matters, I guess the file is simply
too big to be served by TBNL. See this message:
If you think this is not the cause for the error try this (with or
without TBNL loaded):
(with-open-file (file "/path/to/tbnl-test-1"
:direction :input
:element-type '(unsigned-byte 8))
(let* ((len (file-length file))
(buf (make-array len :element-type '(unsigned-byte 8))))
(read-sequence buf file)
'OK))
Does that work? Can you check (with diff) whether tbnl-test-1 and the
file you uploaded are identical?
Cheers,
Edi.
From edi at agharta.de Tue Mar 15 02:19:59 2005
From: edi at agharta.de (Edi Weitz)
Date: Tue, 15 Mar 2005 03:19:59 +0100
Subject: [tbnl-devel] Re: New version 0.4.0
In-Reply-To: <99f74eac2d1e5e90e834b99366001ada@recursive.ca> (Bob
Hutchison's message of "Mon, 14 Mar 2005 19:30:48 -0500")
References:
<99f74eac2d1e5e90e834b99366001ada@recursive.ca>
Message-ID:
On Mon, 14 Mar 2005 19:30:48 -0500, Bob Hutchison wrote:
> Hit port 3000 from your browser, for example
> in my setup. You have to apply
> the patches to Araneida 0.9 of course, and *make* *sure* you recompile
> and use ASDF to load it.
Hmm, I can't seem to reproduce the memory leaks you reported. I've
reloaded the info.html page from the test suite about 200 times and
the output of (ROOM) is stable. LW 4.4.0 on WinXP.
BTW, how exactly does this direct connection to port 3000 work?
Araneida isn't used at all and all the communication with the browser
is directly handled by TBNL? (Yeah, I could look it up myself but
it's 3 a.m. here and I'm tired... :)
Cheers,
Edi.
From hutch at recursive.ca Tue Mar 15 12:08:34 2005
From: hutch at recursive.ca (Bob Hutchison)
Date: Tue, 15 Mar 2005 07:08:34 -0500
Subject: [tbnl-devel] Re: New version 0.4.0
In-Reply-To:
References:
<99f74eac2d1e5e90e834b99366001ada@recursive.ca>
Message-ID: <72939d1df179df4d4967d157413a6598@recursive.ca>
On Mar 14, 2005, at 8:36 PM, Edi Weitz wrote:
> On Mon, 14 Mar 2005 19:30:48 -0500, Bob Hutchison
> wrote:
>
>> Encountered a little problem. In araneida-test it seems that the
>> setq of the *dispatch-table* has to be a top level form the way the
>> path to the fz.jpg file is written. If you move it out of the setup
>> code and onto the top level then compile and load (in Lispworks) it
>> will work... at least for me.
>
> Hmm, that should be irrelevant as I had the SETQ disabled with #+(or).
> The *DISPATCH-TABLE* is supposed to be set by the top-level form in
> test.lisp. You did load the test as described here
>
> ,
>
> didn't you?
I guess the trouble started when I restarted it.
>
> Cheers,
> Edi.
>
>
----
Bob Hutchison -- blogs at
Recursive Design Inc. --
From edi at agharta.de Tue Mar 15 12:13:58 2005
From: edi at agharta.de (Edi Weitz)
Date: Tue, 15 Mar 2005 13:13:58 +0100
Subject: [tbnl-devel] Re: New version 0.4.0
In-Reply-To: <72939d1df179df4d4967d157413a6598@recursive.ca> (Bob
Hutchison's message of "Tue, 15 Mar 2005 07:08:34 -0500")
References:
<99f74eac2d1e5e90e834b99366001ada@recursive.ca>
<72939d1df179df4d4967d157413a6598@recursive.ca>
Message-ID:
On Tue, 15 Mar 2005 07:08:34 -0500, Bob Hutchison wrote:
> I guess the trouble started when I restarted it.
You did (STOP) and then (START) again? And what happened? Is that a
reproducible problem?
Thanks,
Edi.
From hutch at recursive.ca Tue Mar 15 12:34:29 2005
From: hutch at recursive.ca (Bob Hutchison)
Date: Tue, 15 Mar 2005 07:34:29 -0500
Subject: [tbnl-devel] Re: New version 0.4.0
In-Reply-To:
References:
<99f74eac2d1e5e90e834b99366001ada@recursive.ca>
Message-ID:
On Mar 14, 2005, at 9:19 PM, Edi Weitz wrote:
> On Mon, 14 Mar 2005 19:30:48 -0500, Bob Hutchison
> wrote:
>
>> Hit port 3000 from your browser, for example
>> in my setup. You have to apply
>> the patches to Araneida 0.9 of course, and *make* *sure* you recompile
>> and use ASDF to load it.
>
> Hmm, I can't seem to reproduce the memory leaks you reported. I've
> reloaded the info.html page from the test suite about 200 times and
> the output of (ROOM) is stable. LW 4.4.0 on WinXP.
I'm using LW 4.4.0 on OS/X
I ran the following commands
ab -n 200 -c 10 http://localhost:3000/tbnl-araneida | tee
results.ab.3000
ab -n 200 -c 10 http://localhost:3000/tbnl-araneida | tee
results.ab.3000
ab -n 1400 -c 10 http://localhost:3000/tbnl-araneida | tee
results.ab.3000
Then using the process monitor saw the following growth (in MB):
before after 400 after 1400
real 70.74 77.86 89.82
virtual 249.16 461.91 969.97
(room) before
Generation 0: Total Size 14505K, Allocated 9137K, Free 5335K
Generation 1: Total Size 18806K, Allocated 3796K, Free 14977K
Generation 2: Total Size 16196K, Allocated 11197K, Free 4977K
Generation 3: Total Size 10631K, Allocated 10518K, Free 67K
(room) after 400
Generation 0: Total Size 14505K, Allocated 1964K, Free 12509K
Generation 1: Total Size 18934K, Allocated 3422K, Free 15479K
Generation 2: Total Size 18756K, Allocated 11816K, Free 6914K
Generation 3: Total Size 10631K, Allocated 10518K, Free 67K
(room) after 1400
Generation 0: Total Size 14505K, Allocated 1778K, Free 12694K
Generation 1: Total Size 19062K, Allocated 3454K, Free 15575K
Generation 2: Total Size 25796K, Allocated 11816K, Free 13954K
Generation 3: Total Size 10631K, Allocated 10518K, Free 67K
>
> BTW, how exactly does this direct connection to port 3000 work?
> Araneida isn't used at all and all the communication with the browser
> is directly handled by TBNL? (Yeah, I could look it up myself but
> it's 3 a.m. here and I'm tired... :)
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.
Cheers,
Bob
>
> Cheers,
> Edi.
>
>
----
Bob Hutchison -- blogs at
Recursive Design Inc. --
From edi at agharta.de Tue Mar 15 12:39:16 2005
From: edi at agharta.de (Edi Weitz)
Date: Tue, 15 Mar 2005 13:39:16 +0100
Subject: [tbnl-devel] Re: New version 0.4.0
In-Reply-To: (Bob
Hutchison's message of "Tue, 15 Mar 2005 07:34:29 -0500")
References:
<99f74eac2d1e5e90e834b99366001ada@recursive.ca>
Message-ID:
On Tue, 15 Mar 2005 07:34:29 -0500, Bob Hutchison 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?
From hutch at recursive.ca Tue Mar 15 12:56:35 2005
From: hutch at recursive.ca (Bob Hutchison)
Date: Tue, 15 Mar 2005 07:56:35 -0500
Subject: [tbnl-devel] Re: New version 0.4.0
In-Reply-To:
References:
<99f74eac2d1e5e90e834b99366001ada@recursive.ca>
Message-ID:
On Mar 15, 2005, at 7:39 AM, Edi Weitz wrote:
> On Tue, 15 Mar 2005 07:34:29 -0500, Bob Hutchison
> 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
Recursive Design Inc. --
From hutch at recursive.ca Tue Mar 15 12:58:45 2005
From: hutch at recursive.ca (Bob Hutchison)
Date: Tue, 15 Mar 2005 07:58:45 -0500
Subject: [tbnl-devel] Re: New version 0.4.0
In-Reply-To:
References:
<99f74eac2d1e5e90e834b99366001ada@recursive.ca>
<72939d1df179df4d4967d157413a6598@recursive.ca>
Message-ID:
On Mar 15, 2005, at 7:13 AM, Edi Weitz wrote:
> On Tue, 15 Mar 2005 07:08:34 -0500, Bob Hutchison
> wrote:
>
>> I guess the trouble started when I restarted it.
>
> You did (STOP) and then (START) again? And what happened? Is that a
> reproducible problem?
If I start it the way you document the startup of LW fails because
multiprocessing isn't running yet. So I've got to run start later.
The start that I wrote, attempts to stop first.
The other thing that I wanted to be able to do is add handlers without
restarting LW, that takes a long time in my configuration (a couple of
minutes).
Cheers,
Bob
>
> Thanks,
> Edi.
>
>
----
Bob Hutchison -- blogs at
Recursive Design Inc. --
From edi at agharta.de Tue Mar 15 15:11:48 2005
From: edi at agharta.de (Edi Weitz)
Date: Tue, 15 Mar 2005 16:11:48 +0100
Subject: [tbnl-devel] Re: New version 0.4.0
In-Reply-To: (Bob
Hutchison's message of "Tue, 15 Mar 2005 07:56:35 -0500")
References:
<99f74eac2d1e5e90e834b99366001ada@recursive.ca>
Message-ID:
On Tue, 15 Mar 2005 07:56:35 -0500, Bob Hutchison wrote:
> 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).
OK, thanks for the info. I'll try to do some more tests and add more
documentation about this feature.
> I didn't do anything about logging for either the stand-alone or
> with-araneida versions.
Maybe we should address this in one of the future releases. Kind of
embarassing if you send your logging data back to the client as a
header... :)
> The next logical step is to write an HTTP header parser for TBNL (or
> negotiate with the Araneida folks to use their code).
Can't we just steal it? Araneida also has a BSD license.
Cheers,
Edi.
From edi at agharta.de Tue Mar 15 15:17:00 2005
From: edi at agharta.de (Edi Weitz)
Date: Tue, 15 Mar 2005 16:17:00 +0100
Subject: [tbnl-devel] Re: New version 0.4.0
In-Reply-To: (Bob
Hutchison's message of "Tue, 15 Mar 2005 07:58:45 -0500")
References:
<99f74eac2d1e5e90e834b99366001ada@recursive.ca>
<72939d1df179df4d4967d157413a6598@recursive.ca>
Message-ID:
On Tue, 15 Mar 2005 07:58:45 -0500, Bob Hutchison wrote:
> If I start it the way you document the startup of LW fails because
> multiprocessing isn't running yet. So I've got to run start later.
I've got
(mp:initialize-multiprocessing)
at the end of my ~/.lispworks file. But I don't understand how
something I describe in the TBNL docs can cause LW startup to fail. I
was assuming that you've already started your Lisp before you load
Araneida and TBNL. What exactly do you mean?
> The other thing that I wanted to be able to do is add handlers
> without restarting LW, that takes a long time in my configuration (a
> couple of minutes).
You should be able to add/remove handlers just by modifying
*DISPATCH-TABLE*, no need to stop or restart anything.
Cheers,
Edi.
From marc.battyani at fractalconcept.com Tue Mar 15 15:24:20 2005
From: marc.battyani at fractalconcept.com (Marc Battyani)
Date: Tue, 15 Mar 2005 16:24:20 +0100
Subject: [tbnl-devel] Re: New version 0.4.0
References: <99f74eac2d1e5e90e834b99366001ada@recursive.ca>
Message-ID: <0aa801c52973$1081ff60$0a02a8c0@marcxp>
"Bob Hutchison" wrote:
[...]
> The next logical step is to write an HTTP header parser for TBNL (or
> negotiate with the Araneida folks to use their code).
I would be very interested to add such a front-end to the mod_lisp
repository. (Some kind of mod_pure_lisp ;-)
Several people (including me) have been interested by the possibility of
having a light-weight stand-alone server compatible with mod_lisp (mostly
for demonstrations or small apps) without all the overhead and constraints
imposed by paserve or areneida. As I posted here some time ago, I used
paserve for this but a clean stand-alone HTTP front-end would be nicer.
Marc
From marc.battyani at fractalconcept.com Tue Mar 15 15:31:17 2005
From: marc.battyani at fractalconcept.com (Marc Battyani)
Date: Tue, 15 Mar 2005 16:31:17 +0100
Subject: [tbnl-devel] Re: New version 0.4.0
References: