Commit d98205d0 authored by Julien Muchembled's avatar Julien Muchembled

ssl: don't care whether EOF is ragged or not

The purpose of suppress_ragged_eofs=False was to micro-optimize the
normal case: when there's no EOF.

But commit 061cd5d8 showed that this
option only turns ragged EOF into an exception. It may be easier for
alternate NEO implementations to close the SSL connection properly. Or
the performance benefit was not worth the risk to freeze a NEO process.
parent 061cd5d8
...@@ -135,8 +135,7 @@ class SocketConnector(object): ...@@ -135,8 +135,7 @@ class SocketConnector(object):
def ssl(self, ssl, on_handshake_done=None): def ssl(self, ssl, on_handshake_done=None):
self.socket = ssl.wrap_socket(self.socket, self.socket = ssl.wrap_socket(self.socket,
server_side=self.is_server, server_side=self.is_server,
do_handshake_on_connect=False, do_handshake_on_connect=False)
suppress_ragged_eofs=False)
self.__class__ = self.SSLHandshakeConnectorClass self.__class__ = self.SSLHandshakeConnectorClass
self.on_handshake_done = on_handshake_done self.on_handshake_done = on_handshake_done
self.queued or self.queued.append('') self.queued or self.queued.append('')
...@@ -279,7 +278,6 @@ class _SSL: ...@@ -279,7 +278,6 @@ class _SSL:
while 1: while 1:
data = self.socket.recv(4096) data = self.socket.recv(4096)
if not data: if not data:
# non-ragged EOF (peer properly closed its side of connection)
self._error('recv', None) self._error('recv', None)
return return
read_buf.feed(data) read_buf.feed(data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment