From randomtalk at gmail.com Tue Feb 1 12:29:09 2005 From: randomtalk at gmail.com (Jason Wang) Date: Tue, 1 Feb 2005 07:29:09 -0500 Subject: [tbnl-devel] a problem while installing.. Message-ID: <939cf2005020104293e8e87a0@mail.gmail.com> hi, i'm using win32 with apache2 installed.. i try to start tbnl (loading went fine..), using (tbnl:start-tbnl), and it just stops, give me a new line, and stops, when i type an enter, it give me a new line, on the bottom, it says pipeline request... (swank: listener-eval " "), then stops again.. is this normal? When i try to load the test page from the web browser (http://localhost/tbnl/test/test.lisp) it gave me a server error Server error! The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script. If you think this is a server error, please contact the webmaster. i put in the lines to httpd.config: LispServer 127.0.0.1 3000 "tbnl" SetHandler lisp-handler anyone know what's happening? -- www.programer.name - my own personal blog : ) From edi at agharta.de Tue Feb 1 18:10:26 2005 From: edi at agharta.de (Edi Weitz) Date: Tue, 01 Feb 2005 19:10:26 +0100 Subject: [tbnl-devel] a problem while installing.. In-Reply-To: <939cf2005020104293e8e87a0@mail.gmail.com> (Jason Wang's message of "Tue, 1 Feb 2005 07:29:09 -0500") References: <939cf2005020104293e8e87a0@mail.gmail.com> Message-ID: Hi! On Tue, 1 Feb 2005 07:29:09 -0500, Jason Wang wrote: > hi, i'm using win32 with apache2 installed.. > > i try to start tbnl (loading went fine..), using (tbnl:start-tbnl), > and it just stops, give me a new line, and stops, when i type an > enter, it give me a new line, on the bottom, it says pipeline > request... (swank: listener-eval " "), then stops again.. is this > normal? When i try to load the test page from the web browser > (http://localhost/tbnl/test/test.lisp) it gave me a server error > > Server error! > > The server encountered an internal error and was unable to complete > your request. Either the server is overloaded or there was an error in > a CGI script. > > If you think this is a server error, please contact the webmaster. > > i put in the lines to httpd.config: > > LispServer 127.0.0.1 3000 "tbnl" > > SetHandler lisp-handler > > > anyone know what's happening? The message you got from Apache most likely means that TBNL wasn't started yet. To further investigate your problem we first need to know which Lisp implementation you are using. AllegroCL? LispWorks? Something else? And which version? Also, the SWANK part in your email very much looks like you're working with SLIME. Try to isolate the problem by starting the TBNL test suite directly from your Lisp listener without using SLIME and see if that makes a difference. Let us know what comes out of this. Cheers, Edi. From randomtalk at gmail.com Tue Feb 1 22:44:34 2005 From: randomtalk at gmail.com (Jason Wang) Date: Tue, 1 Feb 2005 17:44:34 -0500 Subject: [tbnl-devel] a problem while installing.. In-Reply-To: References: <939cf2005020104293e8e87a0@mail.gmail.com> Message-ID: <939cf20050201144475d98a20@mail.gmail.com> mmm.. yes, i'm using slime with emacs, i'm using a program named lisp in a box : http://common-lisp.net/project/lispbox/, not sure if you've heard it before.. wondering, how do you start TBNL test suite directly from my lisp listener? thanks alot for helping me :D Jason -- www.programer.name - my own personal blog : ) From edi at agharta.de Wed Feb 2 20:19:22 2005 From: edi at agharta.de (Edi Weitz) Date: Wed, 02 Feb 2005 21:19:22 +0100 Subject: [tbnl-devel] a problem while installing.. In-Reply-To: <939cf20050201144475d98a20@mail.gmail.com> (Jason Wang's message of "Tue, 1 Feb 2005 17:44:34 -0500") References: <939cf2005020104293e8e87a0@mail.gmail.com> <939cf20050201144475d98a20@mail.gmail.com> Message-ID: On Tue, 1 Feb 2005 17:44:34 -0500, Jason Wang wrote: > mmm.. yes, i'm using slime with emacs, i'm using a program named > lisp in a box : http://common-lisp.net/project/lispbox/, not sure if > you've heard it before.. Yes, I have. > wondering, how do you start TBNL test suite directly from my lisp > listener? Depends on your Lisp implementation, as I said... :) If you're using Lisp in a Box with CLISP you can't deploy TBNL at all. If you're using it with AllegroCL you start AllegroCL directly (from Windows' Start->Programs) and load and start TBNL from there. If you're new to Common Lisp the problem you might encounter when doing this is how to install the libraries (and where) and how to load them. For this you can read my ASDF/ASDF-INSTALL tutorial at and look at Bill Clementson's blog entry here: If that doesn't help don't hesitate to ask more questions. Cheers, Edi. From randomtalk at gmail.com Wed Feb 2 20:57:27 2005 From: randomtalk at gmail.com (Jason Wang) Date: Wed, 2 Feb 2005 15:57:27 -0500 Subject: [tbnl-devel] a problem while installing.. In-Reply-To: References: <939cf2005020104293e8e87a0@mail.gmail.com> <939cf20050201144475d98a20@mail.gmail.com> Message-ID: <939cf20050202125755a56870@mail.gmail.com> On Wed, 02 Feb 2005 21:19:22 +0100, Edi Weitz wrote: > On Tue, 1 Feb 2005 17:44:34 -0500, Jason Wang wrote: > > > mmm.. yes, i'm using slime with emacs, i'm using a program named > > lisp in a box : http://common-lisp.net/project/lispbox/, not sure if > > you've heard it before.. > > Yes, I have. > > > wondering, how do you start TBNL test suite directly from my lisp > > listener? > > Depends on your Lisp implementation, as I said... :) > > If you're using Lisp in a Box with CLISP you can't deploy TBNL at all. > If you're using it with AllegroCL you start AllegroCL directly (from > Windows' Start->Programs) and load and start TBNL from there. > > If you're new to Common Lisp the problem you might encounter when > doing this is how to install the libraries (and where) and how to load > them. For this you can read my ASDF/ASDF-INSTALL tutorial at > > > > and look at Bill Clementson's blog entry here: > > > > If that doesn't help don't hesitate to ask more questions. > > Cheers, > Edi. > > mmm.. well, i followed Bill Clementson's blog, but then, i can't get it to work.. so as you said, Clisp won't work with TBNL.. so can you suggest a free CL editor + implementation that will work with TBNL?? the key word here is free, becuase i'm just 16, there is no way for me to afford anything more than free so far :|.. thanks alot! :D Jason -- www.programer.name - my own personal blog : ) From edi at agharta.de Wed Feb 2 21:16:40 2005 From: edi at agharta.de (Edi Weitz) Date: Wed, 02 Feb 2005 22:16:40 +0100 Subject: [tbnl-devel] a problem while installing.. In-Reply-To: <939cf20050202125755a56870@mail.gmail.com> (Jason Wang's message of "Wed, 2 Feb 2005 15:57:27 -0500") References: <939cf2005020104293e8e87a0@mail.gmail.com> <939cf20050201144475d98a20@mail.gmail.com> <939cf20050202125755a56870@mail.gmail.com> Message-ID: On Wed, 2 Feb 2005 15:57:27 -0500, Jason Wang wrote: > well, i followed Bill Clementson's blog, but then, i can't get it to > work.. so as you said, Clisp won't work with TBNL.. so can you > suggest a free CL editor + implementation that will work with TBNL?? > the key word here is free, becuase i'm just 16, there is no way for > me to afford anything more than free so far :|.. thanks alot! :D Well, if you can't afford anything more than free then dump Windows and install Linux instead, you'll find heaps of free software for that OS including several high-quality Common Lisp implementations like CMUCL and SBCL both of which will work with TBNL. If you want to stick with Windows and you're just using this to learn Lisp you can install a free trial version of one of the commercial Lisps - both AllegroCL from Franz Inc. and LispWorks from LispWorks Ltd. will work with TBNL. AllegroCL can also be integrated into your Lisp In A Box setup AFAIK. LispWorks has its own IDE that's very easy to use. Cheers, Edi. From randomtalk at gmail.com Sat Feb 5 16:33:27 2005 From: randomtalk at gmail.com (Jason Wang) Date: Sat, 5 Feb 2005 11:33:27 -0500 Subject: [tbnl-devel] a problem while installing.. In-Reply-To: References: <939cf2005020104293e8e87a0@mail.gmail.com> <939cf20050201144475d98a20@mail.gmail.com> <939cf20050202125755a56870@mail.gmail.com> Message-ID: <939cf200502050833aa32503@mail.gmail.com> On Wed, 02 Feb 2005 22:16:40 +0100, Edi Weitz wrote: > On Wed, 2 Feb 2005 15:57:27 -0500, Jason Wang wrote: > > > well, i followed Bill Clementson's blog, but then, i can't get it to > > work.. so as you said, Clisp won't work with TBNL.. so can you > > suggest a free CL editor + implementation that will work with TBNL?? > > the key word here is free, becuase i'm just 16, there is no way for > > me to afford anything more than free so far :|.. thanks alot! :D > > Well, if you can't afford anything more than free then dump Windows > and install Linux instead, you'll find heaps of free software for that > OS including several high-quality Common Lisp implementations like > CMUCL and SBCL both of which will work with TBNL. > > If you want to stick with Windows and you're just using this to learn > Lisp you can install a free trial version of one of the commercial > Lisps - both AllegroCL from Franz Inc. and LispWorks from LispWorks > Ltd. will work with TBNL. AllegroCL can also be integrated into your > Lisp In A Box setup AFAIK. LispWorks has its own IDE that's very easy > to use. > > Cheers, > Edi. > > hi, i have successfully installed TBNL, cl-ppcre, cl-who, kmrcl, md5, url-rewrite, cl-base64 on my windows computer :D thanks alot! do you have a tutorial that teaches how to build dynamic pages wtih lisp? also, is there anything that'll interface with mysql database? or do i need it? since in php, mysql is inseparable with php :| what do lisp usually use to store database like info? thanks alot for helping :D -- www.programer.name - my own personal blog : ) From edi at agharta.de Sat Feb 5 17:58:15 2005 From: edi at agharta.de (Edi Weitz) Date: Sat, 05 Feb 2005 18:58:15 +0100 Subject: [tbnl-devel] a problem while installing.. In-Reply-To: <939cf200502050833aa32503@mail.gmail.com> (Jason Wang's message of "Sat, 5 Feb 2005 11:33:27 -0500") References: <939cf2005020104293e8e87a0@mail.gmail.com> <939cf20050201144475d98a20@mail.gmail.com> <939cf20050202125755a56870@mail.gmail.com> <939cf200502050833aa32503@mail.gmail.com> Message-ID: On Sat, 5 Feb 2005 11:33:27 -0500, Jason Wang wrote: > hi, i have successfully installed TBNL, cl-ppcre, cl-who, kmrcl, > md5, url-rewrite, cl-base64 on my windows computer :D thanks alot! Great! Congratulations! > do you have a tutorial that teaches how to build dynamic pages wtih > lisp? No, not really - maybe you can start with test.lisp in the TBNL distribution. Then there's also a lot of stuff about dynamic Lisp websites on the Web. One very inspiring text is Marc Battyani's ILC 2002 talk. You can find the text itself and a video of Marc's presentation here: In fact, you'll find all of the proceedings there, including more stuff about Lisp and the Web. You can also look at CL-EMB for ideas: Lots of other stuff (some of which can be combined with TBNL) can be found here: > also, is there anything that'll interface with mysql database? Sure, there's CLSQL and there are more database options depending on what you want: > or do i need it? since in php, mysql is inseparable with php :| what > do lisp usually use to store database like info? Good question... :) I think it's a common misconception (due to popular frameworks like PHP) that a web application must be based on an SQL database. There's no reason to assume that. Many Lispers prefer other ways to persist their data and you'll also find lots of info about this if you google for it. One interesting approach is what the BKNR guys are doing: (Seems to be down at the moment but once it's up again download and read the talk Manuel Odendahl gave in Hamburg last year. Or email Manuel directly.) OK, hope that helps, Edi. From randomtalk at gmail.com Sat Feb 5 18:33:44 2005 From: randomtalk at gmail.com (Jason Wang) Date: Sat, 5 Feb 2005 13:33:44 -0500 Subject: [tbnl-devel] a problem while installing.. In-Reply-To: References: <939cf2005020104293e8e87a0@mail.gmail.com> <939cf20050201144475d98a20@mail.gmail.com> <939cf20050202125755a56870@mail.gmail.com> <939cf200502050833aa32503@mail.gmail.com> Message-ID: <939cf2005020510332acdcf62@mail.gmail.com> thanks alot :D i'll check them out :D mmm.. one question.. if i want to move my website to a dedicated root server.. how do i move lisp server to it also? i have full root access via SSH.. wat do you need to remotely install lisp stuff on to the root server? thanks alot! :D Jason -- www.programer.name - my own personal blog : ) From edi at agharta.de Sat Feb 5 19:11:07 2005 From: edi at agharta.de (Edi Weitz) Date: Sat, 05 Feb 2005 20:11:07 +0100 Subject: [tbnl-devel] a problem while installing.. In-Reply-To: <939cf2005020510332acdcf62@mail.gmail.com> (Jason Wang's message of "Sat, 5 Feb 2005 13:33:44 -0500") References: <939cf2005020104293e8e87a0@mail.gmail.com> <939cf20050201144475d98a20@mail.gmail.com> <939cf20050202125755a56870@mail.gmail.com> <939cf200502050833aa32503@mail.gmail.com> <939cf2005020510332acdcf62@mail.gmail.com> Message-ID: On Sat, 5 Feb 2005 13:33:44 -0500, Jason Wang wrote: > thanks alot :D i'll check them out :D You're welcome. > mmm.. one question.. if i want to move my website to a dedicated > root server.. how do i move lisp server to it also? i have full root > access via SSH.. wat do you need to remotely install lisp stuff on > to the root server? If you have ssh access you do the same thing as if you had a terminal window open on your desktop machine (assuming this is Linux or some Unix variant). How you actually install your Lisp depends on the specific compiler and the OS. On Debian in most cases you can install the Lisp compiler itself and most of the libraries with apt-get (from the "testing" branch). On Gentoo it's something similar, I think it's called 'emerge.' On other Linux distributions or on, say, FreeBSD it depends. For CMUCL, for example, you download (with, say, wget) the correct tarball from the CMUCL website and untar it in /usr/local - that should be it. To install mod_lisp you can again use apt-get if you're on Debian (and probably emerge on Gentoo) - or you follow the instructions on the TBNL website to install it manually with apxs. For the libraries - if you don't get them via apt-get or emerge you might want to try ASDF-INSTALL. A tutorial can be found here: Does that help? Cheers, Edi. From chris at austin-lane.net Sat Feb 5 22:24:00 2005 From: chris at austin-lane.net (chris at austin-lane.net) Date: Sat, 5 Feb 2005 17:24:00 -0500 (EST) Subject: [tbnl-devel] Problem with ppc/sbcl Message-ID: <20050205222400.D041B214D78@austin-lane.net> I can't get TBNL to stay responsive reliably on SBCL/ppc (which is a no-threads platform). Among other things, it will block in read-line (get-apache-command) when the connection from apache has gone away. Hitting Control-C interrupts the read and pushes the process back to the place where it's accepting the new connection from apache. (Using mod_lisp2). Does anyone have experience with this platform? Is it expected to work? Thanks, --Chris -- Chris Austin-Lane - +1-301-270-6524 - chris at austin-lane.net The #6 Fundamental Truth: It is easier to move a problem around (for example, by moving the problem to a different part of the overall network architecture) than it is to solve it. (RFC 1925) From stesch at no-spoon.de Sun Feb 6 01:52:34 2005 From: stesch at no-spoon.de (Stefan Scholl) Date: Sun, 6 Feb 2005 02:52:34 +0100 Subject: [tbnl-devel] Problem with ppc/sbcl In-Reply-To: <20050205222400.D041B214D78@austin-lane.net> References: <20050205222400.D041B214D78@austin-lane.net> Message-ID: <20050206015233.GA7904@parsec.no-spoon.de> Hi! On 2005-02-05 17:24:00, chris at austin-lane.net wrote: > I can't get TBNL to stay responsive reliably on SBCL/ppc (which is a > no-threads platform). Among other things, it will block in read-line I don't think this could work without a threading SBCL. TBNL uses KMRCL for starting a listener. Which itself just calls a function when there's no threading SBCL or another Common Lisp with multi-processing: #-(or allegro cmu lispworks sb-thread) (funcall func) Regards, Stefan From stesch at no-spoon.de Sun Feb 6 01:56:22 2005 From: stesch at no-spoon.de (Stefan Scholl) Date: Sun, 6 Feb 2005 02:56:22 +0100 Subject: [tbnl-devel] Problem with ppc/sbcl In-Reply-To: <20050206015233.GA7904@parsec.no-spoon.de> References: <20050205222400.D041B214D78@austin-lane.net> <20050206015233.GA7904@parsec.no-spoon.de> Message-ID: <20050206015622.GB7904@parsec.no-spoon.de> On 2005-02-06 02:52:34, Stefan Scholl wrote: > #-(or allegro cmu lispworks sb-thread) (funcall func) This was with KMRCL 1.77. Current version is 1.78, which seems to support openmcl: processes.lisp: (defun make-process (name func) #+allegro (mp:process-run-function name func) #+cmu (mp:make-process func :name name) #+lispworks (mp:process-run-function name nil func) #+sb-thread (sb-thread:make-thread func) #+openmcl (ccl:process-run-function name func) #-(or allegro cmu lispworks sb-thread openmcl) (funcall func) ) From chris at austin-lane.net Sun Feb 6 14:31:47 2005 From: chris at austin-lane.net (chris at austin-lane.net) Date: Sun, 6 Feb 2005 09:31:47 -0500 (EST) Subject: [tbnl-devel] Problem with ppc/sbcl In-Reply-To: <20050206015622.GB7904@parsec.no-spoon.de> (message from Stefan Scholl on Sun, 6 Feb 2005 02:56:22 +0100) References: <20050205222400.D041B214D78@austin-lane.net> <20050206015233.GA7904@parsec.no-spoon.de> <20050206015622.GB7904@parsec.no-spoon.de> Message-ID: <20050206143147.28E42214D7B@austin-lane.net> >>>>> "Stefan" == Stefan Scholl writes: Stefan> I don't think this could work without a threading Stefan> SBCL. TBNL uses KMRCL for starting a listener. Which Stefan> itself just calls a function when there's no threading Stefan> SBCL or another Common Lisp with multi-processing: Stefan> #-(or allegro cmu lispworks sb-thread) (funcall Stefan> func) Stefan, Thanks for the answer. Any opinion on whether it would be easier to hack tbnl to use the serve-event non-threads loop or switch a TBNL script to run under Araneida (which I understand but do not know does not require threads). I have an additional question, I am currently getting an encoding error because the input stream is :EXTERNAL-FORMAT :ASCII and the POST'ed matter is in UTF8 or Latin-1 or whatever. Anyone else see this? --Chris -- Chris Austin-Lane - +1-301-270-6524 - chris at austin-lane.net People do as much work in 7 40-hour weeks as in 7 50-hour weeks. From edi at agharta.de Sun Feb 6 16:26:56 2005 From: edi at agharta.de (Edi Weitz) Date: Sun, 06 Feb 2005 17:26:56 +0100 Subject: [tbnl-devel] Problem with ppc/sbcl In-Reply-To: <20050206143147.28E42214D7B@austin-lane.net> (chris@austin-lane.net's message of "Sun, 6 Feb 2005 09:31:47 -0500 (EST)") References: <20050205222400.D041B214D78@austin-lane.net> <20050206015233.GA7904@parsec.no-spoon.de> <20050206015622.GB7904@parsec.no-spoon.de> <20050206143147.28E42214D7B@austin-lane.net> Message-ID: On Sun, 6 Feb 2005 09:31:47 -0500 (EST), wrote: > Thanks for the answer. Any opinion on whether it would be easier to > hack tbnl to use the serve-event non-threads loop or switch a TBNL > script to run under Araneida (which I understand but do not know > does not require threads). Hmm, no idea. You should search for an example of proper SERVE-EVENT usage (I seem to remember that Thomas Burdick posted something like that to the small-cl-sources list some time ago) and try to apply it to mod_lisp. I don't know enough of Araneida to answer the other half of the question. I'd be happy to accept clean patches to enable TBNL to use SERVE-EVENT. > I have an additional question, I am currently getting an encoding > error because the input stream is :EXTERNAL-FORMAT :ASCII and the > POST'ed matter is in UTF8 or Latin-1 or whatever. Anyone else see > this? You're talking about the data coming from the browser? That's strange. Do you have a simple example to reproduce that behaviour? Cheers, Edi. From chris at austin-lane.net Tue Feb 8 11:03:11 2005 From: chris at austin-lane.net (chris at austin-lane.net) Date: Tue, 8 Feb 2005 06:03:11 -0500 (EST) Subject: [tbnl-devel] Problem with ppc/sbcl In-Reply-To: (message from Edi Weitz on Sun, 06 Feb 2005 17:26:56 +0100) References: <20050205222400.D041B214D78@austin-lane.net> <20050206015233.GA7904@parsec.no-spoon.de> <20050206015622.GB7904@parsec.no-spoon.de> <20050206143147.28E42214D7B@austin-lane.net> Message-ID: <20050208110311.3AC521CE967@austin-lane.net> >>>>> "Edi" == Edi Weitz writes: Edi> I'd be happy to accept clean patches to enable TBNL to use Edi> SERVE-EVENT. So clean patches are my current goal :) >> I have an additional question, I am currently getting an >> encoding error because the input stream is :EXTERNAL-FORMAT >> :ASCII and the POST'ed matter is in UTF8 or Latin-1 or >> whatever. Anyone else see this? Edi> You're talking about the data coming from the browser? Edi> That's strange. Do you have a simple example to reproduce Edi> that behaviour? I stopped this by setting the LC_ALL locale to en_US.UTF-8 before starting lisp, and adding an explicit chartset=UTF-8 to the webpages. My previous locale, Posix, caused lisp to use ASCII as the default :EXTERNAL-FORMAT (which caused it to reject chars > 127). thanks, --Chris -- Chris Austin-Lane - +1-301-270-6524 - chris at austin-lane.net "He is a self-made man &worships his creator." - John Bright From edi at agharta.de Tue Feb 8 20:10:39 2005 From: edi at agharta.de (Edi Weitz) Date: Tue, 08 Feb 2005 21:10:39 +0100 Subject: [tbnl-devel] Problem with ppc/sbcl In-Reply-To: <20050208110311.3AC521CE967@austin-lane.net> (chris@austin-lane.net's message of "Tue, 8 Feb 2005 06:03:11 -0500 (EST)") References: <20050205222400.D041B214D78@austin-lane.net> <20050206015233.GA7904@parsec.no-spoon.de> <20050206015622.GB7904@parsec.no-spoon.de> <20050206143147.28E42214D7B@austin-lane.net> <20050208110311.3AC521CE967@austin-lane.net> Message-ID: On Tue, 8 Feb 2005 06:03:11 -0500 (EST), wrote: > So clean patches are my current goal :) Good... :) > I stopped this by setting the LC_ALL locale to en_US.UTF-8 before > starting lisp, and adding an explicit chartset=UTF-8 to the > webpages. My previous locale, Posix, caused lisp to use ASCII as > the default :EXTERNAL-FORMAT (which caused it to reject chars > > 127). OK. This is the SBCL Unicode branch, right? Can it change the external format of a stream on the fly like CLISP and (I think) AllegroCL? Cheers, Edi. From chris at austin-lane.net Tue Feb 8 21:55:08 2005 From: chris at austin-lane.net (chris at austin-lane.net) Date: Tue, 8 Feb 2005 16:55:08 -0500 (EST) Subject: [tbnl-devel] Problem with ppc/sbcl In-Reply-To: (message from Edi Weitz on Tue, 08 Feb 2005 21:10:39 +0100) References: <20050205222400.D041B214D78@austin-lane.net> <20050206015233.GA7904@parsec.no-spoon.de> <20050206015622.GB7904@parsec.no-spoon.de> <20050206143147.28E42214D7B@austin-lane.net> <20050208110311.3AC521CE967@austin-lane.net> Message-ID: <20050208215508.B6D091CEB42@austin-lane.net> >>>>> "Edi" == Edi Weitz writes: Edi> OK. This is the SBCL Unicode branch, right? Can it change Edi> the external format of a stream on the fly like CLISP and (I Edi> think) AllegroCL? According to #lisp, no (and that is recognized as a limitation). --Chris -- Chris Austin-Lane - +1-301-270-6524 - chris at austin-lane.net The complexity of software is an essential property, not an accidental one. Hence, descriptions of a software entity that abstract away its complexity often abstract away its essence. - Fred Brooks, Jr. From xach at xach.com Mon Feb 14 13:56:40 2005 From: xach at xach.com (Zach Beane) Date: Mon, 14 Feb 2005 08:56:40 -0500 Subject: [tbnl-devel] arbitrary per-request data? Message-ID: <20050214135640.GI18781@xach.com> I have an application that has a notion of a current user that is lazily established on a per-request basis. For now, I have been returning a handler that is really a lambda wrapping a real handler that lexically binds the special *current-user*: (defun page-handler (request) (multiple-value-bind (handler foundp) (gethash (script-name request) *handlers*) (when foundp (lambda () (let ((*current-user* *current-user-local-unbound-value*)) (funcall handler)))))) 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: request-data key &optional (request *request*) => value, foundp Then I could write CURRENT-USER something like: (defun current-user () (multiple-value-bind (value foundp) (request-data 'user) (if foundp value (setf (request-data 'user) (cookie-user))))) Right now it's a bit messier than that. What do you think? If this seems reasonable I can work out and submit a patch. Zach From edi at agharta.de Mon Feb 14 14:16:42 2005 From: edi at agharta.de (Edi Weitz) Date: Mon, 14 Feb 2005 15:16:42 +0100 Subject: [tbnl-devel] arbitrary per-request data? In-Reply-To: <20050214135640.GI18781@xach.com> (Zach Beane's message of "Mon, 14 Feb 2005 08:56:40 -0500") References: <20050214135640.GI18781@xach.com> Message-ID: On Mon, 14 Feb 2005 08:56:40 -0500, Zach Beane wrote: > I have an application that has a notion of a current user that is > lazily established on a per-request basis. For now, I have been > returning a handler that is really a lambda wrapping a real handler > that lexically binds the special *current-user*: > > (defun page-handler (request) > (multiple-value-bind (handler foundp) > (gethash (script-name request) *handlers*) > (when foundp > (lambda () > (let ((*current-user* *current-user-local-unbound-value*)) > (funcall handler)))))) > > 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: > > request-data key &optional (request *request*) => value, foundp > > Then I could write CURRENT-USER something like: > > (defun current-user () > (multiple-value-bind (value foundp) > (request-data 'user) > (if foundp > value > (setf (request-data 'user) (cookie-user))))) > > Right now it's a bit messier than that. > > What do you think? If this seems reasonable I can work out and > submit a patch. Hi Zach! 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 a bit hesitant to add customized data to the request object because my gut feeling is that by definition it doesn't belong there. Unless you convince me that I'm wrong, of course... :) Cheers, Edi. From xach at xach.com Mon Feb 14 14:36:28 2005 From: xach at xach.com (Zach Beane) Date: Mon, 14 Feb 2005 09:36:28 -0500 Subject: [tbnl-devel] arbitrary per-request data? In-Reply-To: References: <20050214135640.GI18781@xach.com> Message-ID: <20050214143628.GJ18781@xach.com> On Mon, Feb 14, 2005 at 03:16:42PM +0100, Edi Weitz wrote: > > Hi Zach! > > 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'll take a look at sessions for this purpose. Zach From randomtalk at gmail.com Sun Feb 20 22:28:45 2005 From: randomtalk at gmail.com (Jason Wang) Date: Sun, 20 Feb 2005 17:28:45 -0500 Subject: [tbnl-devel] a problem while installing.. In-Reply-To: References: <939cf2005020104293e8e87a0@mail.gmail.com> <939cf20050202125755a56870@mail.gmail.com> <939cf200502050833aa32503@mail.gmail.com> <939cf2005020510332acdcf62@mail.gmail.com> <939cf2005020511251634c6e8@mail.gmail.com> Message-ID: <939cf200502201428347bd04@mail.gmail.com> hi, i'm back again... aftering trying to get Fedora Core 3 to work for about a week, tired of trying for now, i'll get back at it when i learn more lisp :D.. so now i have taken ur earlier advice in downloading trial version of Allegro CL, do you know how i can integrate into my lisp in a box? since you have said it's possible, is it possible in the trial version? thanks alot! -- www.programer.name - my own personal blog : ) From edi at agharta.de Sun Feb 20 22:59:35 2005 From: edi at agharta.de (Edi Weitz) Date: Sun, 20 Feb 2005 23:59:35 +0100 Subject: [tbnl-devel] a problem while installing.. In-Reply-To: <939cf200502201428347bd04@mail.gmail.com> (Jason Wang's message of "Sun, 20 Feb 2005 17:28:45 -0500") References: <939cf2005020104293e8e87a0@mail.gmail.com> <939cf20050202125755a56870@mail.gmail.com> <939cf200502050833aa32503@mail.gmail.com> <939cf2005020510332acdcf62@mail.gmail.com> <939cf2005020511251634c6e8@mail.gmail.com> <939cf200502201428347bd04@mail.gmail.com> Message-ID: On Sun, 20 Feb 2005 17:28:45 -0500, Jason Wang wrote: > hi, i'm back again... aftering trying to get Fedora Core 3 to work > for about a week, tired of trying for now, i'll get back at it when > i learn more lisp :D.. > > so now i have taken ur earlier advice in downloading trial version > of Allegro CL, do you know how i can integrate into my lisp in a > box? since you have said it's possible, is it possible in the trial > version? Looks so - their website offers an "Allegro Trial Edition module," have you tried it? As they are on common-lisp.net they should also have a mailing list where you can ask if you're stuck. Cheers, Edi. From randomtalk at gmail.com Sun Feb 20 23:12:48 2005 From: randomtalk at gmail.com (Jason Wang) Date: Sun, 20 Feb 2005 18:12:48 -0500 Subject: [tbnl-devel] a problem while installing.. In-Reply-To: References: <939cf2005020104293e8e87a0@mail.gmail.com> <939cf200502050833aa32503@mail.gmail.com> <939cf2005020510332acdcf62@mail.gmail.com> <939cf2005020511251634c6e8@mail.gmail.com> <939cf200502201428347bd04@mail.gmail.com> Message-ID: <939cf200502201512289f568b@mail.gmail.com> mmm.. nope, wouldn't work.. i hit it's heap size limit :|.. just wondering, why wouldn't it work with clisp? lol. thanks alot :D -- www.programer.name - my own personal blog : ) From edi at agharta.de Sun Feb 20 23:27:04 2005 From: edi at agharta.de (Edi Weitz) Date: Mon, 21 Feb 2005 00:27:04 +0100 Subject: [tbnl-devel] a problem while installing.. In-Reply-To: <939cf200502201512289f568b@mail.gmail.com> (Jason Wang's message of "Sun, 20 Feb 2005 18:12:48 -0500") References: <939cf2005020104293e8e87a0@mail.gmail.com> <939cf200502050833aa32503@mail.gmail.com> <939cf2005020510332acdcf62@mail.gmail.com> <939cf2005020511251634c6e8@mail.gmail.com> <939cf200502201428347bd04@mail.gmail.com> <939cf200502201512289f568b@mail.gmail.com> Message-ID: On Sun, 20 Feb 2005 18:12:48 -0500, Jason Wang wrote: > just wondering, why wouldn't it work with clisp? CLISP doesn't have multi-threading. From xach at xach.com Mon Feb 21 15:58:21 2005 From: xach at xach.com (Zach Beane) Date: Mon, 21 Feb 2005 10:58:21 -0500 Subject: [tbnl-devel] verbatim post parameter access? Message-ID: <20050221155820.GF18781@xach.com> I'm implementing a PayPal IPN handler in TBNL. The process works like this: 1. paypal receives a payment for your account 2. paypal POSTs the details of the transaction to an URL you specify, e.g. http://tbnlhosting.com/xach/process-ipn 3. you POST the body of their POST back to a paypal URL, with one additional variable appended 4. paypal replies to the POST with "VERIFIED" or "INVALID" Is it possible to get the verbatim body of a POST request with TBNL? I noticed there's a header-in value of "content-stream", but it's not documented. Zach From edi at agharta.de Mon Feb 21 16:10:59 2005 From: edi at agharta.de (Edi Weitz) Date: Mon, 21 Feb 2005 17:10:59 +0100 Subject: [tbnl-devel] verbatim post parameter access? In-Reply-To: <20050221155820.GF18781@xach.com> (Zach Beane's message of "Mon, 21 Feb 2005 10:58:21 -0500") References: <20050221155820.GF18781@xach.com> Message-ID: On Mon, 21 Feb 2005 10:58:21 -0500, Zach Beane wrote: > I'm implementing a PayPal IPN handler in TBNL. The process works like > this: > > 1. paypal receives a payment for your account > > 2. paypal POSTs the details of the transaction to an URL you > specify, e.g. http://tbnlhosting.com/xach/process-ipn > > 3. you POST the body of their POST back to a paypal URL, with one > additional variable appended > > 4. paypal replies to the POST with "VERIFIED" or "INVALID" > > Is it possible to get the verbatim body of a POST request with TBNL? > I noticed there's a header-in value of "content-stream", but it's > not documented. Hi Zach! No, at the moment you can't. CONTENT-STREAM is not documented because it's of no use once the request object has been created. I think the best way to implement this would be to add a new slot (something like "RAW-POST-DATA") to the request object and only fill it if some special variable which usually is NIL has a true value. What do you think? If you want to work on this the meat of it should be around line 110 in request.lisp and you should also decide if you want to do the same thing for multipart/form-data POST requests. I can also do this but probably not this week - I'm pretty busy. So, clean patches including documentation are preferred... :) Cheers, Edi. From xach at xach.com Mon Feb 21 16:59:44 2005 From: xach at xach.com (Zach Beane) Date: Mon, 21 Feb 2005 11:59:44 -0500 Subject: [tbnl-devel] verbatim post parameter access? In-Reply-To: References: <20050221155820.GF18781@xach.com> Message-ID: <20050221165944.GG18781@xach.com> On Mon, Feb 21, 2005 at 05:10:59PM +0100, Edi Weitz wrote: > Hi Zach! > > No, at the moment you can't. CONTENT-STREAM is not documented because > it's of no use once the request object has been created. I think the > best way to implement this would be to add a new slot (something like > "RAW-POST-DATA") to the request object and only fill it if some > special variable which usually is NIL has a true value. What do you > think? Sounds good to me. > If you want to work on this the meat of it should be around line 110 > in request.lisp and you should also decide if you want to do the same > thing for multipart/form-data POST requests. > > I can also do this but probably not this week - I'm pretty busy. So, > clean patches including documentation are preferred... :) Ok, attached is a patch. I have tested it for a few cases and it seems to work. Zach -------------- next part -------------- Only in tbnl-0.3.10: cookie.fasl diff -ur tbnl-0.3.10-orig/doc/index.html tbnl-0.3.10/doc/index.html --- tbnl-0.3.10-orig/doc/index.html 2005-01-24 06:48:13.000000000 -0500 +++ tbnl-0.3.10/doc/index.html 2005-02-21 11:54:29.000000000 -0500 @@ -86,6 +86,7 @@
  • get-parameters
  • post-parameter
  • post-parameters +
  • raw-post-data
  • parameter
  • header-in
  • headers-in @@ -216,6 +217,7 @@
  • read-from-string*
  • http-token-p
  • *tmp-directory* +
  • *save-raw-post-data-p*
  • Debugging TBNL applications
      @@ -624,6 +626,16 @@


      [Function] +
      raw-post-data &optional request => string + +


      +If
      *SAVE-RAW-POST-DATA-P* is +true and the request is a POST request, returns the raw body of +the request, otherwise returns nil. +
      + +


      [Function]
      parameter name &optional request => string


      @@ -1490,6 +1502,16 @@ This should be a pathname denoting a directory where temporary files can be stored. It is used for file uploads.
      +


      [Special variable] +
      *save-raw-post-data-p* + +


      +If this variable is set to a true value (the default is +NIL), when a POST request is received, the raw body is +saved, and may be retrieved with RAW-POST-DATA.
      +

      Debugging TBNL applications

      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... :) Only in tbnl-0.3.10/doc: index.html~ Only in tbnl-0.3.10: html.fasl Only in tbnl-0.3.10: log.fasl Only in tbnl-0.3.10: modlisp.fasl Only in tbnl-0.3.10: packages.fasl diff -ur tbnl-0.3.10-orig/packages.lisp tbnl-0.3.10/packages.lisp --- tbnl-0.3.10-orig/packages.lisp 2005-01-24 06:50:46.000000000 -0500 +++ tbnl-0.3.10/packages.lisp 2005-02-21 11:31:57.000000000 -0500 @@ -46,6 +46,7 @@ #:*lisp-warnings-log-level* #:*listener* #:*log-lisp-backtraces-p* + #:*save-raw-post-data-p* #:*log-lisp-errors-p* #:*log-lisp-warnings-p* #:*log-prefix* @@ -130,6 +131,7 @@ #:get-parameter #:get-parameters #:handle-if-modified-since + #:raw-post-data #:header-in #:headers-in #:header-out Only in tbnl-0.3.10: packages.lisp~ Only in tbnl-0.3.10: reply.fasl Only in tbnl-0.3.10: request.fasl diff -ur tbnl-0.3.10-orig/request.lisp tbnl-0.3.10/request.lisp --- tbnl-0.3.10-orig/request.lisp 2005-01-24 06:50:46.000000000 -0500 +++ tbnl-0.3.10/request.lisp 2005-02-21 11:57:38.000000000 -0500 @@ -50,7 +50,10 @@ (session :initform nil :accessor session :documentation "The session object associated with this -request.")) +request.") + (raw-post-data :initform nil + :documentation "The raw string sent as the body of a +POST request, populated only if *SAVE-RAW-POST-DATA-P* is non-nil.")) (:documentation "Objects of this class hold all the information about an incoming request. They are created automatically by TBNL and can be accessed by the corresponding handler.")) @@ -114,6 +117,8 @@ (let ((content (make-string (parse-integer content-length :junk-allowed t)))) (read-sequence content content-stream) + (when *save-raw-post-data-p* + (setf (slot-value request 'raw-post-data) content)) content))))) ((starts-with-p content-type "multipart/form-data;" :test #'char-equal) (handler-case @@ -309,3 +314,6 @@ (setf (return-code) +http-not-modified+) (throw 'tbnl-handler-done nil)) (values))) + +(defun raw-post-data (&optional (request *request*)) + (slot-value request 'raw-post-data)) Only in tbnl-0.3.10: request.lisp.orig Only in tbnl-0.3.10: request.lisp~ Only in tbnl-0.3.10: rfc2388.fasl Only in tbnl-0.3.10: session.fasl Only in tbnl-0.3.10: specials.fasl diff -ur tbnl-0.3.10-orig/specials.lisp tbnl-0.3.10/specials.lisp --- tbnl-0.3.10-orig/specials.lisp 2005-01-24 06:50:46.000000000 -0500 +++ tbnl-0.3.10/specials.lisp 2005-02-21 11:26:27.000000000 -0500 @@ -182,6 +182,10 @@ occurs. Will only have effect of *LOG-LISP-ERRORS-P* or *LOG-LISP-BACKTRACES* are also true.") +(defvar *save-raw-post-data-p* nil + "Whether the body of a POST request is made available through +RAW-POST-DATA.") + (defvar-unbound *command* "The current request as read from Apache/mod_lisp, converted into an alist.") Only in tbnl-0.3.10: specials.lisp~ Only in tbnl-0.3.10: util.fasl From edi at agharta.de Mon Feb 21 21:29:02 2005 From: edi at agharta.de (Edi Weitz) Date: Mon, 21 Feb 2005 22:29:02 +0100 Subject: [tbnl-devel] New version 0.3.11 Message-ID: Changelog: Version 0.3.11 2005-02-21 Added ability to access raw post data (suggested and coded by Zach Beane) Download: Cheers, Edi. From edi at agharta.de Fri Feb 25 20:33:56 2005 From: edi at agharta.de (Edi Weitz) Date: Fri, 25 Feb 2005 21:33:56 +0100 Subject: [tbnl-devel] Re: TBNL Example In-Reply-To: <421F1226.7000703@open.ac.uk> (Lukas Trejtnar's message of "Fri, 25 Feb 2005 11:55:18 +0000") References: <421F1226.7000703@open.ac.uk> Message-ID: Hi Lukas! Please use the mailing list for further questions and comments. Thanks. On Fri, 25 Feb 2005 11:55:18 +0000, Lukas Trejtnar wrote: > I have been using the mod_lisp module for a couple of years where I > written a Lisp counterpart myself. I didn't implement a > session/cookie management and because of that would like to start > using your TBNL library. It looks like a great piece of work. Thanks... :) > I was reading through a documentation of TBNL and not sure about > testing session expiration. My scenario would be a login page where > a user would authorise and a new session would be created, then a > user would browse pages and the session would be every time checked > if it didn't expire. If it did, a user would be redirected to the > login page. It's a standard scenario, I guess. Here comes my > question. > > How do I hook up 'session expires' to the authorisation? After > reading the documentation, I assume, that I would modify a value of > *session-removal-hook* to redirection function. Is it how you > designed it? Do you have any practical examples? I'm not sure I fully understand your question, or maybe we're talking about different things. If you're using TBNL's session facility you don't have to keep track of session expiry yourself - TBNL will do that for you. If you have the same idea about session expiry that TBNL has, that is. Each session object has a slot which holds the number of seconds this session is valid without user interaction - see the docs for SESSION-MAX-TIME.[1] If the user is idle longer than this period then the session will be automatically invalidated. This doesn't necessary mean that the session object is garbage-collected at this point but it /does/ mean that you can't access the session object anymore, i.e. TBNL will behave as if there had never been a session object. In other words: Usually you shouldn't have to care about *SESSION-REMOVAL-HOOK*, it's a finalizer kind of thing that's rarely useful. Now, sessions aren't necessarily related to authorization but they can be used for it. One approach that I've been using is the following: After a successful login the server stores some kind of object in the session which "proofs" that the user is authorized, like this: (setf (session-value 'user) (make-foo-object)) Then I can wrap all pages requiring authorization into a macro that looks like this (untested): (defmacro with-authorization (&body body) `(cond ((is-foo-object (session-value 'user)) , at body) (t (redirect "/login-page.html")))) Does that answer your question? Cheers, Edi. PS: I'll be away for two days so I probably won't answer before monday. [1] Just noticed that the default value (30 minutes) isn't documented and *SESSION-MAX-TIME* isn't exported. This'll be fixed in a future release. From stesch at no-spoon.de Fri Feb 25 21:35:18 2005 From: stesch at no-spoon.de (Stefan Scholl) Date: Fri, 25 Feb 2005 22:35:18 +0100 Subject: [tbnl-devel] Re: TBNL Example In-Reply-To: References: <421F1226.7000703@open.ac.uk> Message-ID: <20050225213518.GL29337@parsec.no-spoon.de> On 2005-02-25 21:33:56, Edi Weitz wrote: > SESSION-MAX-TIME.[1] If the user is idle longer than this period then > the session will be automatically invalidated. This doesn't necessary > mean that the session object is garbage-collected at this point but it > /does/ mean that you can't access the session object anymore, > i.e. TBNL will behave as if there had never been a session object. But I hope the session will be removed at some time, even when nobody tries to access an expired session? From edi at agharta.de Fri Feb 25 21:51:17 2005 From: edi at agharta.de (Edi Weitz) Date: Fri, 25 Feb 2005 22:51:17 +0100 Subject: [tbnl-devel] Re: TBNL Example In-Reply-To: <20050225213518.GL29337@parsec.no-spoon.de> (Stefan Scholl's message of "Fri, 25 Feb 2005 22:35:18 +0100") References: <421F1226.7000703@open.ac.uk> <20050225213518.GL29337@parsec.no-spoon.de> Message-ID: On Fri, 25 Feb 2005 22:35:18 +0100, Stefan Scholl wrote: > But I hope the session will be removed at some time, even when > nobody tries to access an expired session? Yes, see the code for SESSION-GC. It will be removed at some time unless nobody tries to access any session at all, whether expired or not. To make this more clear: 1. Whenever you try to access an expired session it will be automatically removed and thus your Lisp is free to garbage-collect it now. 2. Whenever any session whatsoever is accessed a global counter is increased and at certain intervals (there's a special variable for that but I don't think it's exported) all sessions which are expired will be removed even if their users haven't accesses them. This implies that sessions might stay in the Lisp image for a long time (although expired) /if/ there's no traffic /or/ if there's only traffic that doesn't use sessions. The alternative would be a separate thread which checks for expired session independently of server traffic. I think that's overly complex, though, and the benefit of the current solution is that it kind of automatically adapts to the server load. Cheers, Edi. From xach at xach.com Fri Feb 25 22:01:01 2005 From: xach at xach.com (Zach Beane) Date: Fri, 25 Feb 2005 17:01:01 -0500 Subject: [tbnl-devel] Re: TBNL Example In-Reply-To: References: <421F1226.7000703@open.ac.uk> <20050225213518.GL29337@parsec.no-spoon.de> Message-ID: <20050225220100.GG11816@xach.com> On Fri, Feb 25, 2005 at 10:51:17PM +0100, Edi Weitz wrote: > The alternative would be a separate thread which checks for expired > session independently of server traffic. I think that's overly > complex, though, and the benefit of the current solution is that it > kind of automatically adapts to the server load. An option I've used in the past and intend to use with TBNL in the future is to have a set of URLs with access restrictions and whose handlers perform required periodic tasks. Then you could do something like this from cron: 30 * * * * wget http://my.site.com/secret/hourly-stuff (This sort of thing is not needed for sessions for the reasons you provide, but I thought I'd bring up the possibility of a non-thread solution for tasks that need to be done periodically.) Zach From hutch at recursive.ca Fri Feb 25 21:00:44 2005 From: hutch at recursive.ca (Bob Hutchison) Date: Fri, 25 Feb 2005 16:00:44 -0500 Subject: [tbnl-devel] Weird problem with cookies and startup Message-ID: <0a1167846989690c928c841f43f22751@recursive.ca> Hi, I've been using TBNL for a few weeks and am encountering some strange behaviour when sessions time out. Specifically, once a session times out I start getting multiple cookies written to the browser -- as the user navigates around the site the cookie, and so the session, changes. I am wondering if this is a known problem. If so, maybe some advice. Otherwise, I'll try to isolate the problem better so I can provide a more precise description of what is happening. There is another problem for which I have no explanation: when the lisp system is first started up it takes several attempts to load the page before the page is loaded (it isn't getting as far as the lisp program I think). Same thing: if this is familiar, maybe some advice... otherwise I'll try to describe the problem better. I'm using Lispworks 4.4 professional on OS/X (10.3.8) using what ever the current versions of Apache 1.x (for OS/X) and mod_lisp. Other that that, TBNL works beautifully. Very nice. Cheers, Bob ---- Bob Hutchison -- blogs at Recursive Design Inc. -- From edi at agharta.de Fri Feb 25 22:17:27 2005 From: edi at agharta.de (Edi Weitz) Date: Fri, 25 Feb 2005 23:17:27 +0100 Subject: [tbnl-devel] Weird problem with cookies and startup In-Reply-To: <0a1167846989690c928c841f43f22751@recursive.ca> (Bob Hutchison's message of "Fri, 25 Feb 2005 16:00:44 -0500") References: <0a1167846989690c928c841f43f22751@recursive.ca> Message-ID: Hi Bob! On Fri, 25 Feb 2005 16:00:44 -0500, Bob Hutchison wrote: > I've been using TBNL for a few weeks and am encountering some > strange behaviour when sessions time out. Specifically, once a > session times out I start getting multiple cookies written to the > browser -- as the user navigates around the site the cookie, and so > the session, changes. > > I am wondering if this is a known problem. If so, maybe some > advice. Otherwise, I'll try to isolate the problem better so I can > provide a more precise description of what is happening. I haven't seen that yet. If you could provide a reproducible test case that'd be very nice. > There is another problem for which I have no explanation: when the > lisp system is first started up it takes several attempts to load > the page before the page is loaded (it isn't getting as far as the > lisp program I think). Same thing: if this is familiar, maybe some > advice... otherwise I'll try to describe the problem better. Had you used TBNL and/or mod_lisp before and then restarted the Lisp? You might be fighting with Apache children trying to use now-dead socket connections to the old Lisp image. If that's the case restarting Apache is your best solution, `apachectl graceful' should suffice. > I'm using Lispworks 4.4 professional on OS/X (10.3.8) using what > ever the current versions of Apache 1.x (for OS/X) and mod_lisp. I don't use Macs so I hope this is not a Mac-specific problem that I can't debug. Cheers, Edi. From hutch at recursive.ca Fri Feb 25 22:30:54 2005 From: hutch at recursive.ca (Bob Hutchison) Date: Fri, 25 Feb 2005 17:30:54 -0500 Subject: [tbnl-devel] Weird problem with cookies and startup In-Reply-To: References: <0a1167846989690c928c841f43f22751@recursive.ca> Message-ID: <5616d00158194f8cac9232cf72b8c50d@recursive.ca> On Feb 25, 2005, at 5:17 PM, Edi Weitz wrote: > Hi Bob! > > On Fri, 25 Feb 2005 16:00:44 -0500, Bob Hutchison > wrote: > >> I've been using TBNL for a few weeks and am encountering some >> strange behaviour when sessions time out. Specifically, once a >> session times out I start getting multiple cookies written to the >> browser -- as the user navigates around the site the cookie, and so >> the session, changes. >> >> I am wondering if this is a known problem. If so, maybe some >> advice. Otherwise, I'll try to isolate the problem better so I can >> provide a more precise description of what is happening. > > I haven't seen that yet. If you could provide a reproducible test > case that'd be very nice. OK, I should be able to get something together, though it might take a couple of days. > >> There is another problem for which I have no explanation: when the >> lisp system is first started up it takes several attempts to load >> the page before the page is loaded (it isn't getting as far as the >> lisp program I think). Same thing: if this is familiar, maybe some >> advice... otherwise I'll try to describe the problem better. > > Had you used TBNL and/or mod_lisp before and then restarted the Lisp? > You might be fighting with Apache children trying to use now-dead > socket connections to the old Lisp image. > > If that's the case restarting Apache is your best solution, `apachectl > graceful' should suffice. There's an idea... I wish I had thought of it. I'll give that a shot. I've got a feeling that somehow these two problems are related. I'll try the restart and see if that fixes both problems -- if nothing else, it'll eliminate some odd stuff. > >> I'm using Lispworks 4.4 professional on OS/X (10.3.8) using what >> ever the current versions of Apache 1.x (for OS/X) and mod_lisp. > > I don't use Macs so I hope this is not a Mac-specific problem that I > can't debug. So do I :-) Thanks, Bob > > Cheers, > Edi. > > ---- Bob Hutchison -- blogs at Recursive Design Inc. -- From hutch at recursive.ca Sun Feb 27 14:00:38 2005 From: hutch at recursive.ca (Bob Hutchison) Date: Sun, 27 Feb 2005 09:00:38 -0500 Subject: [tbnl-devel] Weird problem with cookies and startup In-Reply-To: <0a1167846989690c928c841f43f22751@recursive.ca> References: <0a1167846989690c928c841f43f22751@recursive.ca> Message-ID: <0224d6459e28da2a8ff023d8939c2dfb@recursive.ca> On Feb 25, 2005, at 4:00 PM, Bob Hutchison wrote: > Hi, > > I've been using TBNL for a few weeks and am encountering some strange > behaviour when sessions time out. Specifically, once a session times > out I start getting multiple cookies written to the browser -- as the > user navigates around the site the cookie, and so the session, > changes. > > I am wondering if this is a known problem. If so, maybe some advice. > Otherwise, I'll try to isolate the problem better so I can provide a > more precise description of what is happening. The restart does not fix this problem, but it is a lot clearer what is going on. I still have not isolated the problem, I'll try to do that today (if I don't manage it today other things will start interfering and it'll take a bit longer) This happens with both safari and firefox (I haven't tried any other browsers), though the behaviour is a bit different. In the case of Safari I get a cookie for each page I visited in the previous 'session' plus one new cookie. In the case of firefox, I get two cookies: the old one and the new one, and there is some sort of confusion between the two. Firefox is a simpler situation so I'll try to isolate the problem using it. > > There is another problem for which I have no explanation: when the > lisp system is first started up it takes several attempts to load the > page before the page is loaded (it isn't getting as far as the lisp > program I think). Same thing: if this is familiar, maybe some > advice... otherwise I'll try to describe the problem better. The restart of Apache fixes this as far as I can tell. Thanks for the suggestion. > > I'm using Lispworks 4.4 professional on OS/X (10.3.8) using what ever > the current versions of Apache 1.x (for OS/X) and mod_lisp. > > Other that that, TBNL works beautifully. Very nice. > > Cheers, > Bob > ---- > Bob Hutchison -- blogs at > Recursive Design Inc. -- > > _______________________________________________ > 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 Feb 27 14:11:16 2005 From: hutch at recursive.ca (Bob Hutchison) Date: Sun, 27 Feb 2005 09:11:16 -0500 Subject: [tbnl-devel] Weird problem with cookies and startup In-Reply-To: <0224d6459e28da2a8ff023d8939c2dfb@recursive.ca> References: <0a1167846989690c928c841f43f22751@recursive.ca> <0224d6459e28da2a8ff023d8939c2dfb@recursive.ca> Message-ID: <91adaa4605057bad72bb191c5c17c931@recursive.ca> On Feb 27, 2005, at 9:00 AM, Bob Hutchison wrote: > Firefox is a simpler situation so I'll try to isolate the problem > using it. > I was wrong. Firefox and Safari behave identically. ---- Bob Hutchison -- blogs at Recursive Design Inc. -- From edi at agharta.de Sun Feb 27 16:46:36 2005 From: edi at agharta.de (Edi Weitz) Date: Sun, 27 Feb 2005 17:46:36 +0100 Subject: [tbnl-devel] Re: problems compiling TBNL 0.3.11 in SBCL 0.8.19 In-Reply-To: <9455991c37e6884a78a261706ef0bef7@yahoo.com> (John Wiseman's message of "Fri, 25 Feb 2005 23:54:42 -0800") References: <9455991c37e6884a78a261706ef0bef7@yahoo.com> Message-ID: Hi John! [Cc to mailing list.] On Fri, 25 Feb 2005 23:54:42 -0800, John Wiseman wrote: > Hi, Edi. I just wanted to let you know that I had some trouble > compiling TBNL 0.3.11 in SBCL 0.8.19: > > ; /usr/local/lib/sbcl/site/tbnl-0.3.11/test/test.fasl written > ; compilation finished in 0:00:02 > > debugger invoked on a SB-INT:STREAM-DECODING-ERROR in thread 1771: > decoding error on stream > # \"/usr/local/lib/sbcl/site/tbnl-0.3.11/test/fz.jpg\"" {48E6BF81}> > (:EXTERNAL-FORMAT :UTF-8): > the octet sequence (255 216 255 224) cannot be decoded. > > You can type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL. > > restarts (invokable by number or by possibly-abbreviated name): > 0: [ATTEMPT-RESYNC ] Attempt to resync the stream at a character > boundary > and continue. > 1: [FORCE-END-OF-FILE] Force an end of file. > 2: [RETRY ] Retry performing # {48002121}> on > #. > 3: [ACCEPT ] Continue, treating # {48002121}> on > # as > having > been successful. > 4: [RETRY ] Retry installation > 5: [ABORT ] Reduce debugger level (leaving debugger, > returning to > toplevel). > 6: [TOPLEVEL ] Restart at toplevel READ/EVAL/PRINT loop. > (SB-INT:STREAM-DECODING-ERROR > 2 > # \"/usr/local/lib/sbcl/site/tbnl-0.3.11/test/fz.jpg\"" {48E6BF81}> > (255 216 255 224))[:EXTERNAL] Looks like SBCL is expecting an UTF-8 encoded stream. But this is a JPG file and should be read as a sequence of octets. I'm not familiar with SBCL's new Unicode facilities, I guess you have to provide the right external format when opening the stream. TBNL on the SBCL/Mac combo won't work, though, because TBNL needs threads. Cheers, Edi.