[Lispweb] IMHO + mod_lisp

Ng Pheng Siong ngps at netmemetic.com
Tue May 7 03:43:17 CDT 2002


Hi,

I managed to get IMHO (the CVS version) working with mod_lisp on my FreeBSD
boxen with CMUCL 18d.

I had to make a small change to mod-lisp.lisp:

*** cut here ***
--- mod-lisp.lisp.org   Tue May  7 16:32:53 2002
+++ mod-lisp.lisp       Tue May  7 16:33:13 2002
@@ -129,7 +129,7 @@
       
       (write-string "end" stream)
       (write-char #\NewLine stream)
-      (write-sequence body stream))))
+      (write-string body stream))))
 
 
 ;; the "main" function which reads and executes a request    
*** cut here ***

Without the change, mod-lisp gives a weird error which is best illustrated
by example:

* (init/application 'testapp1 :start :connector :mod-lisp)
* (init/imho :report)
;; IMHO server process is running
;; session timeout monitor is running
;; 
;; IMHO listener is running

Then, in the another buffer I fire up Python (since I haven't figured out
how to do client-side HTTP in CL):

>>> import urllib
>>> u = urllib.urlopen('http://localhost/imho/testapp1')

Looks good... but:

>>> print u.read()
Status
200 OK
Content-Type
text/html
Content-Length
477
end

>>> 

And in the *cmulisp* buffer:

* Warning:
   Error in mod-lisp-server Type-error in WRITE-SEQUENCE:
                               "<html><head><title>Application Error</title></head><body><pre>#&lt;IMHO::TESTAPP1 {48A83605}&gt;: An error occurred during processing:
Type-error in WRITE-SEQUENCE:
   \"&lt;!DOCTYPE HTML PUBLIC \\\"-//W3C//DTD HTML 4.01 Transitional//EN\\\"&gt;
&lt;HTML&gt;
&lt;head&gt;&lt;title&gt;Untitled Page&lt;/title&gt;&lt;!----&gt;&lt;style TYPE&3D\\\"text/css\\\"&gt;&lt;!--
// --&gt;&lt;/style&gt;&lt;!--BEGIN: Script Components--&gt;&lt;script TYPE&3D\\\"text/javascript\\\"&gt;&lt;!--
// Start of Instances

function imho_init_instances() {}

// --&gt;&lt;/script&gt;&lt;/head&gt;&lt;BODY ONLOAD&3D\\\"imho_init_instances();\\\"&gt;&lt;!--start html-element: TESTAPP1-ELEMENT, C1683, C1683--&gt;Hello World!&lt;!--end html-element: TESTAPP1-ELEMENT, C1683, C1683--&gt;&lt;/BODY&gt;&lt;/HTML&gt;\" is not of type (UNSIGNED-BYTE
                                                                                                                                                                                                                          8)</pre></body></html>" is not of type (UNSIGNED-BYTE
                                                                                                                                                                                                                                                                  8)

Looks like write-sequence croaked when attempting to write testapp1's HTML
output... 

BTW, mod_webapp doesn't work for me: the first time I connect, the Apache
child process responsible for my connection segfaults; subsequent ones
report the error "cannot switch to passive mode". 

Is mod_lisp favoured over mod_webapp?

Cheers.
-- 
Ng Pheng Siong <ngps at netmemetic.com> * http://www.netmemetic.com




More information about the lispweb mailing list