Skip to content

Commit e070e9c

Browse files
committed
Clarify what _outgoing_app_size counts in sslproto comments
1 parent 8f1b557 commit e070e9c

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎Lib/asyncio/sslproto.py‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ def __init__(self, loop, app_protocol, sslcontext, waiter,
308308
# App data write buffering
309309
self._write_backlog = collections.deque()
310310
self._write_buffer_size = 0
311-
# How much of self._outgoing is encrypted app data
311+
# How much of self._outgoing was produced by _do_write(): encrypted
312+
# app data, plus anything else OpenSSL flushed along with it
312313
self._outgoing_app_size = 0
313314

314315
self._waiter = waiter
@@ -902,9 +903,10 @@ def _control_ssl_reading(self):
902903
# Also count the records OpenSSL writes on its own while reading
903904
# (alerts, KeyUpdate replies, ...) which the peer does not read:
904905
# the app is not involved in producing them, so pausing it does
905-
# not bound them; only pausing reads from the peer does. App data
906-
# is left out so that two peers which both write before they read
907-
# cannot deadlock.
906+
# not bound them; only pausing reads from the peer does. Whatever
907+
# was produced while writing app data (_outgoing_app_size) is left
908+
# out so that two peers which both write before they read cannot
909+
# deadlock.
908910
size = (self._get_read_buffer_size() +
909911
self._outgoing.pending - self._outgoing_app_size)
910912
if size >= self._incoming_high_water and not self._ssl_reading_paused:

0 commit comments

Comments
 (0)