r5232: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 4 Jul 2003 22:41:06 +0000 (22:41 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Fri, 4 Jul 2003 22:41:06 +0000 (22:41 +0000)
base.lisp
data-structures.lisp [deleted file]
debian/control
impl-acl.lisp
modlisp.asd
variables.lisp [new file with mode: 0644]

index 07cc986ed44c756670cf046d4b2c6ed05909afd6..15ff3e12a450b4b42d3b2cfd136ad3292735b25e 100644 (file)
--- 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)
       (*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
 (defun debug-table (command)
   (with-output-to-string (s)
    (write-string "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">
-<HTML><HEAD></HEAD><BODY><TABLE bgcolor=\"#c0c0c0\">
-<TR bgcolor=\"yellow\"><TH COLSPAN=2>ACL 6.2 + mod_lisp 2.0 + apache + Linux</TH></TR>
-<TR bgcolor=\"yellow\"><TH>Key</TH><TH>Value</TH></TR>" s)
+<html><head></head>
+<body>
+<table><tbody>
+<tr><t colspan=\"2\">mod_lisp debug</th></tr>
+<tr><th>Key</th><th>Value</th></tr>" s)
    (format s "<TR bgcolor=\"#F0F0c0\"><TD>apache-nb-use-socket</TD><TD>~a</TD></TR>"  *apache-nb-use-socket*)
    (loop for (key . value) in command do
-        (format s "<TR bgcolor=\"#F0F0c0\"><TD>~a</TD><TD>~a</TD></TR>" key value))
-   (write-string "</TABLE></BODY></HTML>" s)))
+        (format s "<tr><td>~a</td><td>~a</td></tr>" key value))
+   (write-string "</tbody></table></body></html>" s)))
 
 (defun fixed-html ()
   "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML//EN\">
-<HTML><HEAD></HEAD><BODY><H1>mod_lisp 2.0</H1><P>This is a constant
-  html string sent by mod_lisp</P></BODY></HTML>")
+<html><head></head><body><h1>mod_lisp</h1>
+<p>This is a constant html string sent by mod_lisp</p></body></html>")
diff --git a/data-structures.lisp b/data-structures.lisp
deleted file mode 100644 (file)
index 4bab962..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10; Package: modlisp -*-
-;;;; *************************************************************************
-;;;; FILE IDENTIFICATION
-;;;;
-;;;; Name:          base.lisp
-;;;; Purpose:       Base data and functions for modlisp package
-;;;; Programmer:    Kevin M. Rosenberg
-;;;; Date Started:  Dec 2002
-;;;;
-;;;; $Id: data-structures.lisp,v 1.1 2003/07/04 19:52:32 kevin Exp $
-;;;; *************************************************************************
-
-(in-package #:modlisp)
-
-(defvar *listener-count* 0
-  "used to name listeners")
-
-(defvar *worker-count* 0
-  "used to name workers")
-
-(defvar *listener-socket*
-  "Socket for the listener")
-
-(defvar *listener-proc* nil
-  "Process for the listener")
-
-(defconstant +default-apache-port+ 13244
-  "Default port for listen")
-
-(defvar *apache-socket* nil
-  "the socket stream to apache")
-
-(defvar *close-apache-socket* nil
-  "set to T if you want to close the socket to apache after
-the current command")
-
-(defvar *apache-nb-use-socket* 0
-  "the number of requests sent in this socket")
-
index 320b62df2cc9d3ef6062c6fb63635c0fa75e01d9..b726ddc37def5ec1ab9bb74b1d52c6d49047035a 100644 (file)
@@ -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.
index 47f5c14f4d7aa247eb31b9c4f0828de97f3220c3..48f30e326eacbd195c8c275dfe08c2c986796b64 100644 (file)
                                          :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))))
index 7876e3cf180dd17c72f04fe01af0a02b3e6e7f70..95a75b77aacb03dcbf5414e3618e96fb93225502 100644 (file)
@@ -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))
 
 #+(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/variables.lisp b/variables.lisp
new file mode 100644 (file)
index 0000000..2edf38b
--- /dev/null
@@ -0,0 +1,39 @@
+;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10; Package: modlisp -*-
+;;;; *************************************************************************
+;;;; FILE IDENTIFICATION
+;;;;
+;;;; Name:          base.lisp
+;;;; Purpose:       Base data and functions for modlisp package
+;;;; Programmer:    Kevin M. Rosenberg
+;;;; Date Started:  Dec 2002
+;;;;
+;;;; $Id: variables.lisp,v 1.1 2003/07/04 22:41:06 kevin Exp $
+;;;; *************************************************************************
+
+(in-package #:modlisp)
+
+(defvar *listener-count* 0
+  "used to name listeners")
+
+(defvar *worker-count* 0
+  "used to name workers")
+
+(defvar *listener-socket*
+  "Socket for the listener")
+
+(defvar *listener-proc* nil
+  "Process for the listener")
+
+(defconstant +default-apache-port+ 20123
+  "Default port for listen")
+
+(defvar *apache-socket* nil
+  "the socket stream to apache")
+
+(defvar *close-apache-socket* nil
+  "set to T if you want to close the socket to apache after
+the current command")
+
+(defvar *apache-nb-use-socket* 0
+  "the number of requests sent in this socket")
+