mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Use threadpool for reading from file in sendfile fallback mode (#14076)
This commit is contained in:
parent
ef2152354f
commit
0237265e82
2 changed files with 2 additions and 1 deletions
|
@ -1141,7 +1141,7 @@ class BaseEventLoop(events.AbstractEventLoop):
|
|||
if blocksize <= 0:
|
||||
return total_sent
|
||||
view = memoryview(buf)[:blocksize]
|
||||
read = file.readinto(view)
|
||||
read = await self.run_in_executor(None, file.readinto, view)
|
||||
if not read:
|
||||
return total_sent # EOF
|
||||
await proto.drain()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue