From: Taha Jahangir Date: Sun, 13 Oct 2013 17:43:45 +0000 (+0330) Subject: Don't raise connection reset errors in `set_nodelay` X-Git-Tag: v3.2.0b1~73^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F913%2Fhead;p=thirdparty%2Ftornado.git Don't raise connection reset errors in `set_nodelay` If connection was reset, `request.finish()` wrongly raises socket.error instead of ignoring the error. --- diff --git a/tornado/iostream.py b/tornado/iostream.py index 6bdc6397b..08430ceaf 100644 --- a/tornado/iostream.py +++ b/tornado/iostream.py @@ -774,7 +774,7 @@ class IOStream(BaseIOStream): # Sometimes setsockopt will fail if the socket is closed # at the wrong time. This can happen with HTTPServer # resetting the value to false between requests. - if e.errno != errno.EINVAL: + if e.errno not in (errno.EINVAL, errno.ECONNRESET): raise