[bknr-cvs] hans changed trunk/thirdparty/hunchentoot/taskmaster.lisp

BKNR Commits bknr at bknr.net
Mon Jul 6 09:17:00 UTC 2009


Revision: 4430
Author: hans
URL: http://bknr.net/trac/changeset/4430

Move the HANDLER-CASE to the right place in the code, ugh.

U   trunk/thirdparty/hunchentoot/taskmaster.lisp

Modified: trunk/thirdparty/hunchentoot/taskmaster.lisp
===================================================================
--- trunk/thirdparty/hunchentoot/taskmaster.lisp	2009-07-06 08:47:23 UTC (rev 4429)
+++ trunk/thirdparty/hunchentoot/taskmaster.lisp	2009-07-06 09:17:00 UTC (rev 4430)
@@ -127,9 +127,19 @@
 
 #-:lispworks
 (defmethod handle-incoming-connection ((taskmaster one-thread-per-connection-taskmaster) socket)
-  (bt:make-thread (lambda ()
-                    (process-connection (taskmaster-acceptor taskmaster) socket))
-                  :name (format nil "Hunchentoot worker \(client: ~A)" (client-as-string socket))))
+  ;; We are handling all conditions here as we want to make sure that
+  ;; the acceptor process never crashes while trying to create a
+  ;; worker thread.  One such problem exists in
+  ;; GET-PEER-ADDRESS-AND-PORT which can signal socket conditions on
+  ;; some platforms in certain situations.
+  (handler-case
+      (bt:make-thread (lambda ()
+                        (process-connection (taskmaster-acceptor taskmaster) socket))
+                      :name (format nil "Hunchentoot worker \(client: ~A)" (client-as-string socket)))
+    
+    (error (cond)
+      (log-message *lisp-errors-log-level*
+                   "Error while creating worker thread for new incoming connection: ~A" cond))))
 
 ;; LispWorks implementation
 
@@ -153,17 +163,8 @@
              (zerop (mod *worker-counter* *cleanup-interval*)))
     (when *cleanup-function*
       (funcall *cleanup-function*)))
-  ;; We are handling all conditions here as we want to make sure that
-  ;; the acceptor process never crashes while trying to create a
-  ;; worker thread.  One such problem exists in
-  ;; GET-PEER-ADDRESS-AND-PORT which can signal socket conditions on
-  ;; some platforms in certain situations.
-  (handler-case
-      (mp:process-run-function (format nil "Hunchentoot worker \(client: ~{~A:~A~})"
-                                       (multiple-value-list
-                                        (get-peer-address-and-port handle)))
-                               nil #'process-connection
-                               (taskmaster-acceptor taskmaster) handle)
-    (error (cond)
-      (log-message *lisp-errors-log-level*
-                   "Error while creating worker thread for new incoming connection: ~A" cond))))
+  (mp:process-run-function (format nil "Hunchentoot worker \(client: ~{~A:~A~})"
+                                   (multiple-value-list
+                                    (get-peer-address-and-port handle)))
+                           nil #'process-connection
+                           (taskmaster-acceptor taskmaster) handle))





More information about the Bknr-cvs mailing list