X-Git-Url: http://git.kpe.io/?p=cl-modlisp.git;a=blobdiff_plain;f=impl-acl.lisp;h=48f30e326eacbd195c8c275dfe08c2c986796b64;hp=47f5c14f4d7aa247eb31b9c4f0828de97f3220c3;hb=1bb49e27c591c846849c80b6e543a8b207f9dad4;hpb=118ee93d69e2b09d12eb317f6db3fbda113be82f 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))))