Commit 3ec2ace1db94e89d4d7038714646fd3aae363ebb

Thomas de Grivel 2018-06-15T20:58:01

ignore-errors for request-cont

diff --git a/thot.lisp b/thot.lisp
index aad682a..98cfd28 100644
--- a/thot.lisp
+++ b/thot.lisp
@@ -523,32 +523,33 @@ The requested url "
   (let ((handlers *url-handlers*)
         (*request* request)
         (*reply* reply))
-    (with-simple-restart (continue "Continue")
-      (handler-bind
-          ((cffi-errno:errno-error
-            (lambda (condition)
-              (let ((errno (the fixnum
-                                (errno:errno-error-errno condition))))
-                (when (find errno '(errno:+epipe+
-                                    errno:+econnreset+))
-                  (when (debug-p :thot)
-                    (format t "~&WARN request-cont ~A~%" condition)
-                    (force-output))
-                  (return-from request-cont))))))
-        (loop
-           (let ((handler-form (pop handlers)))
-             (unless handler-form (return))
-             (let ((handler (call-handler-form handler-form)))
-               (when (debug-p :thot)
-                 (format t "~&~S -> ~S~%" handler-form handler)
-                 (force-output))
-               (when handler
-                 (call-handler handler)
-                 (stream-flush (reply-stream% reply))
-                 (return)))))
-        (if (string-equal "keep-alive" (request-header 'connection))
-            :keep-alive
-            nil)))))
+    (ignore-errors
+      (with-simple-restart (continue "Continue")
+        (handler-bind
+            ((cffi-errno:errno-error
+              (lambda (condition)
+                (let ((errno (the fixnum
+                                  (errno:errno-error-errno condition))))
+                  (when (find errno '(errno:+epipe+
+                                      errno:+econnreset+))
+                    (when (debug-p :thot)
+                      (format t "~&WARN request-cont ~A~%" condition)
+                      (force-output))
+                    (return-from request-cont))))))
+          (loop
+             (let ((handler-form (pop handlers)))
+               (unless handler-form (return))
+               (let ((handler (call-handler-form handler-form)))
+                 (when (debug-p :thot)
+                   (format t "~&~S -> ~S~%" handler-form handler)
+                   (force-output))
+                 (when handler
+                   (call-handler handler)
+                   (stream-flush (reply-stream% reply))
+                   (return)))))
+          (if (string-equal "keep-alive" (request-header 'connection))
+              :keep-alive
+              nil))))))
 
 (defvar *stop* nil)