mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
[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 94f4d87aeb
)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
This commit is contained in:
parent
3feebdd61d
commit
9a43485830
2 changed files with 2 additions and 1 deletions
|
@ -1292,8 +1292,8 @@ class BaseEventLoop(events.AbstractEventLoop):
|
|||
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'):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue