mirror of
https://github.com/python/cpython.git
synced 2025-08-15 14:20:55 +00:00
[3.8] Use threadpool for reading from file in sendfile fallback mode (GH-14076) (GH-14102)
(cherry picked from commit 0237265e82
)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
This commit is contained in:
parent
6887814069
commit
b6ff2cd8c5
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