mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
[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 94f4d87aeb)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
This commit is contained in:
parent
18e4eb410a
commit
c1faeadd82
2 changed files with 2 additions and 1 deletions
|
|
@ -1264,8 +1264,8 @@ async def _sendfile_fallback(self, transp, file, offset, count):
|
|||
read = await self.run_in_executor(None, file.readinto, view)
|
||||
if not read:
|
||||
return total_sent # EOF
|
||||
await proto.drain()
|
||||
transp.write(view[:read])
|
||||
await proto.drain()
|
||||
total_sent += read
|
||||
finally:
|
||||
if total_sent > 0 and hasattr(file, 'seek'):
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
Fix sendfile fallback implementation to drain data after writing to transport in :mod:`asyncio`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue