eschulte pushed a commit to branch master
in repository elpa.

commit 912ad475e497db63396d827dd703ec4929e2f35a
Author: Eric Schulte <schulte.e...@gmail.com>
Date:   Wed Dec 18 23:46:51 2013 -0700

    handle close-connection thrown during header parse
---
 emacs-web-server.el |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/emacs-web-server.el b/emacs-web-server.el
index b085723..efcfb5c 100644
--- a/emacs-web-server.el
+++ b/emacs-web-server.el
@@ -131,13 +131,14 @@ function.
   (with-slots (handler clients) (plist-get (process-plist proc) :server)
     (unless (assoc proc clients)
       (push (cons proc (make-instance 'ews-client)) clients))
-    (let ((client (cdr (assoc proc clients))))
-      (when (ews-do-filter client string)
-        (when (not (eq (catch 'close-connection
-                         (ews-call-handler proc (cdr (headers client)) 
handler))
-                       :keep-open))
-          (setq clients (assq-delete-all proc clients))
-          (delete-process proc))))))
+    (let ((c (cdr (assoc proc clients))))
+      (when (not (eq (catch 'close-connection
+                       (if (ews-do-filter c string)
+                           (ews-call-handler proc (cdr (headers c)) handler)
+                         :keep-open))
+                     :keep-open))
+        (setq clients (assq-delete-all proc clients))
+        (delete-process proc)))))
 
 (defun ews-do-filter (client string)
   "Return non-nil when finished and the client may be deleted."

Reply via email to