From 1bb49e27c591c846849c80b6e543a8b207f9dad4 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Fri, 4 Jul 2003 22:41:06 +0000 Subject: [PATCH] r5232: *** empty log message *** --- base.lisp | 49 ++++++++++++----------- debian/control | 2 +- impl-acl.lisp | 55 +++++++++++--------------- modlisp.asd | 11 ++---- data-structures.lisp => variables.lisp | 4 +- 5 files changed, 56 insertions(+), 65 deletions(-) rename data-structures.lisp => variables.lisp (89%) diff --git a/base.lisp b/base.lisp index 07cc986..15ff3e1 100644 --- a/base.lisp +++ b/base.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Dec 2002 ;;;; -;;;; $Id: base.lisp,v 1.1 2003/07/04 19:52:32 kevin Exp $ +;;;; $Id: base.lisp,v 1.2 2003/07/04 22:41:06 kevin Exp $ ;;;; ************************************************************************* (in-package #:modlisp) @@ -17,27 +17,28 @@ (*listener-process* nil)) (defun modlisp-start (&key (port +default-apache-port+) - (function 'sample-process-apache-command)) + (function 'demo-apache-command-processor)) (handler-case - (make-socket-server (next-server-name) function port :format :text - :wait nil) + (make-socket-server (next-server-name) function port + :format :text :wait nil) (error (e) (format t "Error ~A" e) (decf *listener-count*) nil) - (:no-error (proc socket) + (:no-error (process socket) (setq *listener-socket* socket) - (setq *listener-proc* proc) - proc))) - + (setq *listener-process* process) + process))) + (defun modlisp-stop () - (when *listener-proc* - (format t "~&; killing ~d~%" *listener-proc*) - #+sbcl (sb-unix:unix-kill *listener-proc* :sigalrm) - #+allegro (mp:process-kill *listener-proc*) + (when *listener-process* + (format t "~&; killing process ~d~%" *listener-process*) + #+sbcl (sb-thread:destory-thread *listener-process*) + #+allegro (mp:process-kill *listener-process*) #+allegro (mp:process-allow-schedule) - ) - (setq *listener-proc* nil) + #+lispworks (mp:process-kill *listener-process*) + #+cmucl (mp:destroy process *listener-process*) + (setq *listener-process* nil)) (when *listener-socket* (ignore-errors (close *listener-socket*)) (setq *listener-socket* nil))) @@ -51,9 +52,7 @@ (format nil "modlisp-worker-~d" (incf *worker-count*))) -(defun apache-command-issuer (*apache-socket* - &optional - (processor-fun 'demo-apache-command-processor)) +(defun apache-command-issuer (*apache-socket* processor-fun) "generates commands from apache, issues commands to processor-fun" (let ((*close-apache-socket* t)) (unwind-protect @@ -124,15 +123,17 @@ (defun debug-table (command) (with-output-to-string (s) (write-string " - - -" s) + + +
ACL 6.2 + mod_lisp 2.0 + apache + Linux
KeyValue
+mod_lisp debug +" s) (format s "" *apache-nb-use-socket*) (loop for (key . value) in command do - (format s "" key value)) - (write-string "
KeyValue
apache-nb-use-socket~a
~a~a
" s))) + (format s "~a~a" key value)) + (write-string "" s))) (defun fixed-html () " -

mod_lisp 2.0

This is a constant - html string sent by mod_lisp

") +

mod_lisp

+

This is a constant html string sent by mod_lisp

") diff --git a/debian/control b/debian/control index 320b62d..b726ddc 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,7 @@ Standards-Version: 3.5.10.0 Package: cl-modlisp Architecture: all -Depends: ${shlibs:Depends}, common-lisp-controller (>= 3.37),libapache-mod-lisp +Depends: ${shlibs:Depends}, common-lisp-controller (>= 3.37),libapache-mod-lisp,cl-kmrcl Description: Common Lisp interface to the Apache mod-lisp module cl-modlisp provides a Common Lisp interface to the mod-lisp Apache module. The package has support for CMUCL, SBCL, CLISP, AllegroCL, and Lispworks. diff --git a/impl-acl.lisp b/impl-acl.lisp index 47f5c14..48f30e3 100644 --- a/impl-acl.lisp +++ b/impl-acl.lisp @@ -22,41 +22,34 @@ :wait wait))))) (values proc listener))) -(defun worker-process (stream function conn count) - (unwind-protect - #+ignore - (funcall function conn) - - (excl:errorset (close conn) nil))) - (defun start-socket-server (passive-socket function &key wait) ;; internal function run in the server lightweight process ;; that continually processes the connection. ;; This code is careful to ensure that the sockets are ;; properly closed something abnormal happens. (unwind-protect - (loop (let ((connection (socket:accept-connection passive-socket))) - (if wait - (unwind-protect - (funcall connection function) - (excl:errorset (close connection) nil)) - (let ((f function) - (c connection) - (name (next-worker-name)) - (mp:process-run-function - name - #'(lambda () - (unwind-protect - (apache-command-issuer connection function) - #+ignore - (handler-case - (apache-command-issuer function connection) - (error (e) - #+ignore - (format t "~&Error ~A [~A]~%" e name)) - (:no-error () - #+ignore - (format t "~&~A ended" name))) - (excl:errorset (close connection) nil))) - ))))) + (loop + (let ((connection (socket:accept-connection passive-socket))) + (if wait + (unwind-protect + (funcall connection function) + (excl:errorset (close connection) nil)) + (let ((f function) + (c connection) + (name (next-worker-name))) + (mp:process-run-function + name + #'(lambda () + (unwind-protect + (apache-command-issuer connection function) + #+ignore + (handler-case + (apache-command-issuer function connection) + (error (e) + #+ignore + (format t "~&Error ~A [~A]~%" e name)) + (:no-error () + #+ignore + (format t "~&~A ended" name))) + (excl:errorset (close connection) nil)))))))) (ignore-errors (close passive-socket)))) diff --git a/modlisp.asd b/modlisp.asd index 7876e3c..95a75b7 100644 --- a/modlisp.asd +++ b/modlisp.asd @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Dec 2002 ;;;; -;;;; $Id: modlisp.asd,v 1.1 2003/07/04 19:52:32 kevin Exp $ +;;;; $Id: modlisp.asd,v 1.2 2003/07/04 22:41:06 kevin Exp $ ;;;; ************************************************************************* (defpackage #:modlisp-system (:use #:cl #:asdf)) @@ -15,19 +15,16 @@ #+(or allegro clisp cmu lispworks sbcl) (defsystem modlisp - :default-component-class kboot:kmr-cl-source-file - :depends-on (:kmrcl - :base64 - #+sbcl :sb-bsd-sockets) + :depends-on (:kmrcl #+sbcl :sb-bsd-sockets) :components ((:file "package") - (:file "data-structures" :depends-on ("package")) + (:file "variables" :depends-on ("package")) (:file #+allegro "impl-acl" #+clisp "impl-clisp" #+cmu "impl-cmucl" #+sbcl "impl-sbcl" #+lispworks "impl-lispworks" - :depends-on ("data-structures")) + :depends-on ("variables")) (:file "base" :depends-on (#+allegro "impl-acl" #+clisp "impl-clisp" diff --git a/data-structures.lisp b/variables.lisp similarity index 89% rename from data-structures.lisp rename to variables.lisp index 4bab962..2edf38b 100644 --- a/data-structures.lisp +++ b/variables.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Dec 2002 ;;;; -;;;; $Id: data-structures.lisp,v 1.1 2003/07/04 19:52:32 kevin Exp $ +;;;; $Id: variables.lisp,v 1.1 2003/07/04 22:41:06 kevin Exp $ ;;;; ************************************************************************* (in-package #:modlisp) @@ -24,7 +24,7 @@ (defvar *listener-proc* nil "Process for the listener") -(defconstant +default-apache-port+ 13244 +(defconstant +default-apache-port+ 20123 "Default port for listen") (defvar *apache-socket* nil -- 2.34.1