gh-131325: fix sendfile fallback implementation to drain data after writing to transport (#131376)

This commit is contained in:
Kumar Aditya 2025-03-18 00:52:57 +05:30 committed by GitHub
parent 46e88540e6
commit 94f4d87aeb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -1295,8 +1295,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'):

View file

@ -0,0 +1 @@
Fix sendfile fallback implementation to drain data after writing to transport in :mod:`asyncio`.