[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>#<IMHO::TESTAPP1 {48A83605}>: An error occurred during processing:
Type-error in WRITE-SEQUENCE:
\"<!DOCTYPE HTML PUBLIC \\\"-//W3C//DTD HTML 4.01 Transitional//EN\\\">
<HTML>
<head><title>Untitled Page</title><!----><style TYPE&3D\\\"text/css\\\"><!--
// --></style><!--BEGIN: Script Components--><script TYPE&3D\\\"text/javascript\\\"><!--
// Start of Instances
function imho_init_instances() {}
// --></script></head><BODY ONLOAD&3D\\\"imho_init_instances();\\\"><!--start html-element: TESTAPP1-ELEMENT, C1683, C1683-->Hello World!<!--end html-element: TESTAPP1-ELEMENT, C1683, C1683--></BODY></HTML>\" 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