Server: Fix server becoming unresponsive if a client sends invalid SSL data at exactly the right moment

This commit is contained in:
Kovid Goyal 2018-03-08 11:11:17 +05:30
parent a9500f08da
commit 9651296a57
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -273,6 +273,10 @@ class Connection(object): # {{{
self.read_buffer.recv_from(self.socket)
except ssl.SSLWantReadError:
return
except ssl.SSLError as e:
self.log.error('Error while reading SSL data from client: %s' % as_unicode(e))
self.ready = False
return
except socket.error as e:
if e.errno in socket_errors_nonblocking or e.errno in socket_errors_eintr:
return