Skip to content

Commit 9a43485

Browse files
[3.13] gh-131325: fix sendfile fallback implementation to drain data after writing to transport (GH-131376) (#131377)
gh-131325: fix sendfile fallback implementation to drain data after writing to transport (GH-131376) (cherry picked from commit 94f4d87) Co-authored-by: Kumar Aditya <[email protected]>
1 parent 3feebdd commit 9a43485

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Lib/asyncio/base_events.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1292,8 +1292,8 @@ async def _sendfile_fallback(self, transp, file, offset, count):
12921292
read = await self.run_in_executor(None, file.readinto, view)
12931293
if not read:
12941294
return total_sent # EOF
1295-
await proto.drain()
12961295
transp.write(view[:read])
1296+
await proto.drain()
12971297
total_sent += read
12981298
finally:
12991299
if total_sent > 0 and hasattr(file, 'seek'):
Lines changed: 1 addition & 0 deletions
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)