bpo-46487: Add get_write_buffer_limits to Write and _SSLProtocol transports (GH-30958)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 64568acbd8)

Co-authored-by: Emiya <importz750@gmail.com>
This commit is contained in:
Miss Islington (bot) 2022-02-01 11:29:45 -08:00 committed by GitHub
parent a22dd00f2d
commit e4a6e54902
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 0 deletions

View file

@ -367,6 +367,12 @@ class _SSLProtocolTransport(transports._FlowControlMixin,
"""Return the current size of the write buffer."""
return self._ssl_protocol._transport.get_write_buffer_size()
def get_write_buffer_limits(self):
"""Get the high and low watermarks for write flow control.
Return a tuple (low, high) where low and high are
positive number of bytes."""
return self._ssl_protocol._transport.get_write_buffer_limits()
@property
def _protocol_paused(self):
# Required for sendfile fallback pause_writing/resume_writing logic