benoitc/gunicorn

sendfile example does not use sendfile

Fermée

#2 279 ouverte le 27 févr. 2020

 (4 commentaires) (0 réaction) (1 personne assignée)Python (1 707 forks)batch import
To Schedulegood first issue

Métriques du dépôt

Stars
 (9 334 étoiles)
Métriques de merge PR
 (Merge moyen 8h 8m) (1 PR mergée en 30 j)

Description

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

Guide contributeur