]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Don't raise connection reset errors in `set_nodelay` 913/head
authorTaha Jahangir <mtjahangir@gmail.com>
Sun, 13 Oct 2013 17:43:45 +0000 (21:13 +0330)
committerTaha Jahangir <mtjahangir@gmail.com>
Sun, 13 Oct 2013 17:43:45 +0000 (21:13 +0330)
If connection was reset, `request.finish()` wrongly raises socket.error instead of ignoring the error.

tornado/iostream.py

index 6bdc6397baa4269d57971179a430195852ef9e1c..08430ceaf84158ffc0afafb5a32a607d900b91ec 100644 (file)
@@ -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