mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-05-14 02:33:51 +00:00
fixed wsgi.file_wrapper
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user