From: Ben Darnell Date: Sun, 27 Sep 2015 17:05:58 +0000 (-0400) Subject: Quiet another error that can be caused by port scans. X-Git-Tag: v4.3.0b1~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd077ac34749414cc513e2f8374a4524dd9dd50c;p=thirdparty%2Ftornado.git Quiet another error that can be caused by port scans. --- diff --git a/tornado/iostream.py b/tornado/iostream.py index c5d3e2c9d..1e6771045 100644 --- a/tornado/iostream.py +++ b/tornado/iostream.py @@ -1274,10 +1274,11 @@ class SSLIOStream(IOStream): raise except socket.error as err: # Some port scans (e.g. nmap in -sT mode) have been known - # to cause do_handshake to raise EBADF, so make that error - # quiet as well. + # to cause do_handshake to raise EBADF and ENOTCONN, so make + # those errors quiet as well. # https://groups.google.com/forum/?fromgroups#!topic/python-tornado/ApucKJat1_0 - if self._is_connreset(err) or err.args[0] == errno.EBADF: + if (self._is_connreset(err) or + err.args[0] in (errno.EBADF, errno.ENOTCONN)): return self.close(exc_info=True) raise except AttributeError: