gunicorn icon indicating copy to clipboard operation
gunicorn copied to clipboard

sendfile example does not use sendfile

Open hmoffatt opened this issue 5 years ago • 2 comments

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']):

hmoffatt avatar Feb 27 '20 08:02 hmoffatt

thanks! I will test soon as well

benoitc avatar Mar 06 '20 10:03 benoitc

Hi, is this issue still open i would like to work on it

deveshbedmutha1406 avatar Aug 16 '25 12:08 deveshbedmutha1406