From 06b4300d0955c2a5eb948911fc397fb360fa9035 Mon Sep 17 00:00:00 2001 From: "roberto@precise64" Date: Sun, 13 May 2012 06:46:48 +0200 Subject: [PATCH] uwsgi.sendfile is for raw usage --- plugins/python/uwsgi_pymodule.c | 5 ----- welcome.py | 3 ++- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/plugins/python/uwsgi_pymodule.c b/plugins/python/uwsgi_pymodule.c index c182e806..e2fd0ddc 100644 --- a/plugins/python/uwsgi_pymodule.c +++ b/plugins/python/uwsgi_pymodule.c @@ -794,11 +794,6 @@ PyObject *py_uwsgi_advanced_sendfile(PyObject * self, PyObject * args) { wsgi_req->sendfile_fd_chunk = chunk; wsgi_req->sendfile_fd_pos = pos; - // send the headers if not already sent - if (!wsgi_req->headers_sent && wsgi_req->headers_hvec > 0) { - uwsgi_python_do_send_headers(wsgi_req); - } - // do sendfile if (uwsgi.async > 1) { ssize_t sf_len = uwsgi_sendfile(wsgi_req); diff --git a/welcome.py b/welcome.py index 1ab06d4d..b98b577d 100644 --- a/welcome.py +++ b/welcome.py @@ -42,7 +42,8 @@ def xsendfile(e, sr): return '' def serve_logo(e, sr): - sr('200 OK', [('Content-Type', 'image/png')]) + # use raw facilities + uwsgi.send("%s 200 OK\r\nContent-Type: image/png\r\n\r\n" % e['SERVER_PROTOCOL']) return uwsgi.sendfile('logo_uWSGI.png') def serve_options(e, sr):