Skip to content

Commit 9d93438

Browse files
committed
Refs #220, fix leak in closure
1 parent 83ee1e3 commit 9d93438

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

uvloop/sslproto.pxd

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,12 @@ cdef class SSLProtocol:
7676
# Handshake flow
7777

7878
cdef _start_handshake(self)
79-
cdef _check_handshake_timeout(self)
8079
cdef _do_handshake(self)
8180
cdef _on_handshake_complete(self, handshake_exc)
8281

8382
# Shutdown flow
8483

8584
cdef _start_shutdown(self)
86-
cdef _check_shutdown_timeout(self)
8785
cdef _do_flush(self)
8886
cdef _do_shutdown(self)
8987
cdef _on_shutdown_complete(self, shutdown_exc)

uvloop/sslproto.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ cdef class SSLProtocol:
455455
# start handshake timeout count down
456456
self._handshake_timeout_handle = \
457457
self._loop.call_later(self._ssl_handshake_timeout,
458-
lambda: self._check_handshake_timeout())
458+
lambda self: self._check_handshake_timeout(), self)
459459

460460
try:
461461
self._sslobj = self._sslcontext.wrap_bio(
@@ -469,7 +469,7 @@ cdef class SSLProtocol:
469469
else:
470470
self._do_handshake()
471471

472-
cdef _check_handshake_timeout(self):
472+
def _check_handshake_timeout(self):
473473
if self._state == DO_HANDSHAKE:
474474
msg = (
475475
f"SSL handshake is taking longer than "
@@ -535,10 +535,10 @@ cdef class SSLProtocol:
535535
self._set_state(FLUSHING)
536536
self._shutdown_timeout_handle = \
537537
self._loop.call_later(self._ssl_shutdown_timeout,
538-
lambda: self._check_shutdown_timeout())
538+
lambda self: self._check_shutdown_timeout(), self)
539539
self._do_flush()
540540

541-
cdef _check_shutdown_timeout(self):
541+
def _check_shutdown_timeout(self):
542542
if self._state in (FLUSHING, SHUTDOWN):
543543
self._transport._force_close(
544544
aio_TimeoutError('SSL shutdown timed out'))

0 commit comments

Comments
 (0)