Skip to content

Commit d149143

Browse files
author
taras
committed
Add extra comments
1 parent 94f8283 commit d149143

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

uvloop/handles/stream.pyx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1002,7 +1002,12 @@ cdef void __uv_stream_buffered_on_read(
10021002
return
10031003

10041004
try:
1005-
if nread > 0 and sc.__protocol_type != ProtocolType.SSL_PROTOCOL and not sc._read_pybuf_acquired:
1005+
# When our own SSLProtocol is used, we get buffer pointer directly,
1006+
# through SSLProtocol.get_buffer_impl, not through Py_Buffer interface.
1007+
# Therefore sc._read_pybuf_acquired is always False for SSLProtocol.
1008+
if (nread > 0 and
1009+
sc.__protocol_type == ProtocolType.BUFFERED and
1010+
not sc._read_pybuf_acquired):
10061011
# From libuv docs:
10071012
# nread is > 0 if there is data available or < 0 on error. When
10081013
# we’ve reached EOF, nread will be set to UV_EOF. When

0 commit comments

Comments
 (0)