File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -610,17 +610,17 @@ cdef class SSLProtocol:
610610 If close_notify is received for the first time, call eof_received.
611611 """
612612 cdef:
613- bint close_notify = False
613+ bytearray buffer = PyBytes_FromStringAndSize(
614+ NULL , SSL_READ_DEFAULT_SIZE)
615+ Py_ssize_t bytes_read = - 1
614616 try :
615- while True :
616- if not self ._sslobj_read(self ._ssl_read_max_size_obj):
617- close_notify = True
618- break
617+ while bytes_read != 0 :
618+ bytes_read = self ._sslobj_read(self ._ssl_read_max_size_obj, buffer )
619619 except ssl_SSLAgainErrors as exc:
620620 pass
621621 except ssl_SSLZeroReturnError:
622- close_notify = True
623- if close_notify :
622+ bytes_read = 0
623+ if bytes_read == 0 :
624624 self ._call_eof_received(context)
625625
626626 cdef _do_flush(self , object context = None ):
You can’t perform that action at this time.
0 commit comments