Skip to content

Commit d33c852

Browse files
author
taras
committed
Add some comments
1 parent 58ce0be commit d33c852

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

uvloop/sslproto.pxd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,13 @@ cdef class SSLProtocol:
5858
object _incoming_write
5959
object _outgoing
6060
object _outgoing_read
61+
62+
# Buffer for the underlying UVStream buffered reads
6163
bytearray _plain_read_buffer
64+
# Buffer for SSLObject.read calls
65+
# Only allocated when user pass non-buffered Protocol instance
6266
bytearray _ssl_read_buffer
67+
# Cached long object for SSLObject.read calls
6368
object _ssl_read_max_size_obj
6469

6570
SSLProtocolState _state

uvloop/sslproto.pyx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,12 @@ cdef class SSLProtocol:
348348
self._loop.call_soon(self._app_protocol.connection_lost, exc)
349349
self._set_state(UNWRAPPED)
350350
self._transport = None
351+
352+
# Decrease ref counters to user instances to avoid cyclic references
353+
# between user protocol, SSLProtocol and SSLTransport.
354+
# This helps to deallocate useless objects asap.
355+
# If not done then some tests like test_create_connection_memory_leak
356+
# will fail.
351357
self._app_transport = None
352358
self._app_protocol = None
353359
self._app_protocol_get_buffer = None

0 commit comments

Comments
 (0)