PYTHON-4874 - Add KMS support for async Windows (#1939)
This commit is contained in:
parent
8ce21bc121
commit
a62ade864d
@ -205,7 +205,7 @@ else:
|
||||
total_sent += sent
|
||||
|
||||
async def _async_receive_ssl(
|
||||
conn: _sslConn, length: int, dummy: AbstractEventLoop
|
||||
conn: _sslConn, length: int, dummy: AbstractEventLoop, once: Optional[bool] = False
|
||||
) -> memoryview:
|
||||
mv = memoryview(bytearray(length))
|
||||
total_read = 0
|
||||
@ -215,6 +215,9 @@ else:
|
||||
while total_read < length:
|
||||
try:
|
||||
read = conn.recv_into(mv[total_read:])
|
||||
# KMS responses update their expected size after the first batch, stop reading after one loop
|
||||
if once:
|
||||
return mv[:read]
|
||||
if read == 0:
|
||||
raise OSError("connection closed")
|
||||
except BLOCKING_IO_ERRORS:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user