benoitc/gunicorn

sendfile example does not use sendfile

已关闭

#2,279 创建于 2020年2月27日

 (4 条评论) (0 个反应) (1 位负责人)Python (1,707 个派生)batch import
To Schedulegood first issue

仓库指标

星标
 (9,334 个星标)
PR 合并指标
 (平均合并 8小时 8分钟) (30 天内合并 1 个 PR)

描述

The sendfile example application does not actually result in a call to sendfile. I verified this by adding code to http/wsgi.py and also looking at the output of strace.

It works if I remove the @validator decorator on the app method in sendfile.py.

I guess this is because the worker is checking for an instance of the write type, but the type is not the same with the validator wrapper. workers/sync.py handle_request() says

if isinstance(respiter, environ['wsgi.file_wrapper']):

贡献者指南