Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Lib/asyncio/base_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -1296,7 +1296,10 @@ async def _sendfile_native(self, transp, file, offset, count):
async def _sendfile_fallback(self, transp, file, offset, count):
if hasattr(file, 'seek'):
file.seek(offset)
blocksize = min(count, 16384) if count else 16384
blocksize = (
min(count, constants.SENDFILE_FALLBACK_READBUFFER_SIZE)
if count else constants.SENDFILE_FALLBACK_READBUFFER_SIZE
)
buf = bytearray(blocksize)
total_sent = 0
proto = _SendfileFallbackProtocol(transp)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Increase the buffer size to 256 KiB in :meth:`asyncio.loop.sendfile` method fallback.
Loading