Skip to content

Commit 47233ca

Browse files
Use 256 KiB chunksize in _sendfile_fallback
Signed-off-by: Prakash Sellathurai <prakashsellathurai@gmail.com>
1 parent b35c379 commit 47233ca

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Lib/asyncio/base_events.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1296,7 +1296,10 @@ async def _sendfile_native(self, transp, file, offset, count):
12961296
async def _sendfile_fallback(self, transp, file, offset, count):
12971297
if hasattr(file, 'seek'):
12981298
file.seek(offset)
1299-
blocksize = min(count, 16384) if count else 16384
1299+
blocksize = (
1300+
min(count, constants.SENDFILE_FALLBACK_READBUFFER_SIZE)
1301+
if count else constants.SENDFILE_FALLBACK_READBUFFER_SIZE
1302+
)
13001303
buf = bytearray(blocksize)
13011304
total_sent = 0
13021305
proto = _SendfileFallbackProtocol(transp)

0 commit comments

Comments
 (0)