mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +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:
|
if blocksize <= 0:
|
||||||
return total_sent
|
return total_sent
|
||||||
view = memoryview(buf)[:blocksize]
|
view = memoryview(buf)[:blocksize]
|
||||||
read = file.readinto(view)
|
read = await self.run_in_executor(None, file.readinto, view)
|
||||||
if not read:
|
if not read:
|
||||||
return total_sent # EOF
|
return total_sent # EOF
|
||||||
await proto.drain()
|
await proto.drain()
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Use threadpool for reading from file for sendfile fallback mode.
|
Loading…
Add table
Add a link
Reference in a new issue