fixed wsgi.file_wrapper

This commit is contained in:
roberto@precise64
2012-05-12 10:54:35 +02:00
parent 83da420cfc
commit 5fac82cfee
2 changed files with 8 additions and 4 deletions

View File

@@ -253,10 +253,6 @@ PyObject *py_uwsgi_spit(PyObject * self, PyObject * args) {
int uwsgi_python_do_send_headers(struct wsgi_request *wsgi_req) {
uwsgi_log("- headers = %d\n", ((PyObject *)wsgi_req->headers)->ob_refcnt);
uwsgi_log("- status = %p\n", wsgi_req->status_header);
uwsgi_log("- status = %d\n", ((PyObject *)wsgi_req->status_header)->ob_refcnt);
#ifdef __sun__
int remains = wsgi_req->headers_hvec + 1;
int iov_size;

View File

@@ -187,6 +187,10 @@ int uwsgi_response_subhandler_wsgi(struct wsgi_request *wsgi_req) {
#else
if (wsgi_req->sendfile_obj == wsgi_req->async_result && wsgi_req->sendfile_fd != -1) {
#endif
// send the headers if not already sent
if (!wsgi_req->headers_sent && wsgi_req->headers_hvec > 0) {
uwsgi_python_do_send_headers(wsgi_req);
}
sf_len = uwsgi_sendfile(wsgi_req);
if (sf_len < 1) goto clear;
wsgi_req->response_size += sf_len;
@@ -274,6 +278,10 @@ int uwsgi_response_subhandler_wsgi(struct wsgi_request *wsgi_req) {
#ifdef UWSGI_SENDFILE
else if (wsgi_req->sendfile_obj == pychunk && wsgi_req->sendfile_fd != -1) {
// send the headers if not already sent
if (!wsgi_req->headers_sent && wsgi_req->headers_hvec > 0) {
uwsgi_python_do_send_headers(wsgi_req);
}
sf_len = uwsgi_sendfile(wsgi_req);
if (sf_len < 1) goto clear;
wsgi_req->response_size += sf_len;