Skip to content

Commit 4434c63

Browse files
author
taras
committed
Apply suggestions from PR review
1 parent 5971ab7 commit 4434c63

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

uvloop/sslproto.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -722,8 +722,8 @@ cdef class SSLProtocol:
722722
cdef:
723723
Py_ssize_t total_pending = (<Py_ssize_t>self._incoming.pending
724724
+ <Py_ssize_t>self._sslobj_pending())
725-
# Ask for a little extra in case when decrypted data is bigger than
726-
# original
725+
# Ask for a little extra in case when decrypted data is bigger
726+
# than original
727727
object app_buffer = self._app_protocol_get_buffer(
728728
total_pending + 256)
729729
Py_ssize_t app_buffer_size = len(app_buffer)
@@ -747,7 +747,7 @@ cdef class SSLProtocol:
747747
# One way to reduce reliance on SSLWantReadError is to check
748748
# self._incoming.pending > 0 and SSLObject.pending() > 0.
749749
# SSLObject.read may still throw SSLWantReadError even when
750-
# self._incoming.pending > 0 SSLObject.pending() == 0,
750+
# self._incoming.pending > 0 and SSLObject.pending() == 0,
751751
# but this should happen relatively rarely, only when ssl frame
752752
# is partially received.
753753

@@ -775,7 +775,7 @@ cdef class SSLProtocol:
775775
PyBUF_WRITE)
776776

777777
last_bytes_read = <Py_ssize_t>self._sslobj_read(
778-
app_buffer_size, app_buffer)
778+
app_buffer_size - total_bytes_read, app_buffer)
779779
total_bytes_read += last_bytes_read
780780

781781
if last_bytes_read == 0:

0 commit comments

Comments
 (0)