Skip to content

Commit c1faead

Browse files
[3.12] gh-131325: fix sendfile fallback implementation to drain data after writing to transport (GH-131376) (#131378)
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 <kumaraditya@python.org>
1 parent 18e4eb4 commit c1faead

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
@@ -1264,8 +1264,8 @@ async def _sendfile_fallback(self, transp, file, offset, count):
12641264
read = await self.run_in_executor(None, file.readinto, view)
12651265
if not read:
12661266
return total_sent # EOF
1267-
await proto.drain()
12681267
transp.write(view[:read])
1268+
await proto.drain()
12691269
total_sent += read
12701270
finally:
12711271
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)