Allow disabling sendfile w/ env 'AIOHTTP_NOSENDFILE=1'#629
Allow disabling sendfile w/ env 'AIOHTTP_NOSENDFILE=1'#629asvetlov merged 1 commit intoaio-libs:masterfrom
Conversation
Allow disabling sendfile w/ env 'AIOHTTP_NOSENDFILE=1'
|
Perfect! |
|
Wouldn't it be better to do this in line 257 of web_urldispatcher.py, where the implementation of sendfile is chosen? |
|
Maybe you are right. I dont care too much honestly |
|
I wouldn't be able to Perhaps, the other section should be moved into the constructor as well, so we can mock test that as well and get rid of no coverage pragma. It's fine for now, but it's something to consider in the static route refactoring (issue #468) |
There was a problem hiding this comment.
I'm concerned that definition of this environment variable switch is differs from other environment variable switches used in asyncio/aiohttp.
AIOHTTP_NO_EXTENSIONS is checked in the following way:
if bool(os.environ.get('AIOHTTP_NO_EXTENSIONS')):
At least inside aiohttp library environment variables switches should work in the same way.
StaticRoutecan now be forced to not usesendfilesystem call if environment variableAIOHTTP_NOSENDFILE=1.See issue #628