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

BKNR Commits bknr at bknr.net
Mon Feb 9 12:13:27 UTC 2009


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

When you don't understand DO, use LOOP

U   trunk/thirdparty/hunchentoot/server.lisp

Modified: trunk/thirdparty/hunchentoot/server.lisp
===================================================================
--- trunk/thirdparty/hunchentoot/server.lisp	2009-02-09 11:52:41 UTC (rev 4203)
+++ trunk/thirdparty/hunchentoot/server.lisp	2009-02-09 12:13:27 UTC (rev 4204)
@@ -395,20 +395,18 @@
     (mp:process-unstop (server-acceptor server))
     #-:lispworks
     (usocket:with-server-socket (listener (server-listen-socket server))
-      (do ((new-connection-p (usocket:wait-for-input listener :timeout +new-connection-wait-time+)
-                             (usocket:wait-for-input listener :timeout +new-connection-wait-time+)))
-          ((server-shutdown-p server))
-        (when new-connection-p
-          (handler-case
-              (let ((client-connection (usocket:socket-accept listener)))
-                (when client-connection
+      (loop
+         until (server-shutdown-p server)
+         when (usocket:wait-for-input listener :timeout +new-connection-wait-time+)
+         do (handler-case
+                (when-let (client-connection (usocket:socket-accept listener))
                   (set-timeouts client-connection
                                 (server-read-timeout server)
                                 (server-write-timeout server))
                   (handle-incoming-connection (server-connection-manager server)
-                                              client-connection)))
-            ;; ignore condition
-            (usocket:connection-aborted-error ())))))))
+                                              client-connection))
+              ;; ignore condition
+              (usocket:connection-aborted-error ()))))))
 
 (defgeneric initialize-connection-stream (server stream) 
  (:documentation "Wraps the given STREAM with all the additional





More information about the Bknr-cvs mailing list