Properly proxy EOF on the SSLTransport test suite.
Previously the proxy was continuously ignoring EOF signals and keeping
the socket open.
MODIFY
test/test_ssltransport.py
test/test_ssltransport.py
@@ -246,6 +246,7 @@ class SocketProxyDummyServer(SocketDummyServerTestCase):
)
self._read_write_loop(client_sock, upstream_sock)
upstream_sock.close()
+ client_sock.close()
self._start_server(proxy_handler)
@@ -274,6 +275,10 @@ class SocketProxyDummyServer(SocketDummyServerTestCase):
if write_socket in writable:
try:
b = read_socket.recv(chunks)
+ if len(b) == 0:
+ # One of the sockets has EOFed, we return to close
+ # both.
+ return
write_socket.send(b)
except ssl.SSLEOFError:
# It's possible, depending on shutdown order, that we'll
@@ -322,6 +327,7 @@ class TlsInTlsTestCase(SocketDummyServerTestCase):
request = consume_socket(ssock)
validate_request(request)
ssock.send(sample_response())
+ sock.close()
cls._start_server(socket_handler)

Properly proxy EOF on the SSLTransport test suite. (#2218)

Previously the proxy was continuously ignoring EOF signals and keeping
the socket open.

Signed-off-by: Jorge Lopez Silva <jalopezsilva@gmail.com>