From 311126cd8090b5670bd1219e6a67c01857834cfe Mon Sep 17 00:00:00 2001 From: Taha Jahangir Date: Sun, 13 Oct 2013 21:13:45 +0330 Subject: [PATCH] Don't raise connection reset errors in `set_nodelay` If connection was reset, `request.finish()` wrongly raises socket.error instead of ignoring the error. --- tornado/iostream.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tornado/iostream.py b/tornado/iostream.py index 6bdc6397..08430cea 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