Skip to content

Commit 58ce0be

Browse files
author
taras
committed
Fix memory leak in SSLProtocol and test_create_connection_memory_leak test
1 parent 5385ebe commit 58ce0be

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

uvloop/sslproto.pyx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,9 @@ cdef class SSLProtocol:
350350
self._transport = None
351351
self._app_transport = None
352352
self._app_protocol = None
353+
self._app_protocol_get_buffer = None
354+
self._app_protocol_data_received = None
355+
self._app_protocol_buffer_updated = None
353356
self._wakeup_waiter(exc)
354357

355358
if self._shutdown_timeout_handle:
@@ -860,6 +863,8 @@ cdef class SSLProtocol:
860863
elif first_chunk is not None:
861864
self._app_protocol_data_received(first_chunk)
862865

866+
# SSLObject.read() may return 0 instead of throwing SSLWantReadError
867+
# This indicates that we reached EOF
863868
if bytes_read == 0:
864869
# close_notify
865870
self._call_eof_received()

0 commit comments

Comments
 (0)