Skip to content

Commit 43125f3

Browse files
kumaraditya303colesbury
authored andcommitted
pythongh-131325: fix sendfile fallback implementation to drain data after writing to transport (python#131376)
1 parent c987813 commit 43125f3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Lib/asyncio/base_events.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1295,8 +1295,8 @@ async def _sendfile_fallback(self, transp, file, offset, count):
12951295
read = await self.run_in_executor(None, file.readinto, view)
12961296
if not read:
12971297
return total_sent # EOF
1298-
await proto.drain()
12991298
transp.write(view[:read])
1299+
await proto.drain()
13001300
total_sent += read
13011301
finally:
13021302
if total_sent > 0 and hasattr(file, 'seek'):
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix sendfile fallback implementation to drain data after writing to transport in :mod:`asyncio`.

0 commit comments

Comments
 (0)