Ignoring some bad network errors re Robby

This commit is contained in:
Jay McCarthy 2013-04-29 13:20:24 -06:00
parent bbd24edb54
commit 4b84fc7b48

View File

@ -73,6 +73,14 @@
(define conn
(new-connection config:initial-connection-timeout
ip op (current-custodian) #f))
(with-handlers
([(λ (x)
;; This error is "Connection reset by peer" and doesn't
;; really indicate a problem with the server.
(and (exn:fail:network:errno? x)
(= 54 (exn:fail:network:errno-errno x))))
(λ (x)
(kill-connection! conn))])
;; HTTP/1.1 allows any number of requests to come from this input
;; port. However, there is no explicit cancellation of a
;; connection---the browser will just close the port. This leaves
@ -109,4 +117,4 @@
(connection-loop))])))))
(define (connection-loop)
(sync the-evt))
(connection-loop))
(connection-loop)))