use the right sendfile abstraction

This commit is contained in:
Unbit
2013-07-13 17:26:43 +02:00
parent 7513d80440
commit 8887f83f7f
2 changed files with 5 additions and 4 deletions
+4
View File
@@ -71,5 +71,9 @@ int uwsgi_simple_sendfile(struct wsgi_request *wsgi_req, int fd, size_t pos, siz
return -1;
}
}
wsgi_req->response_size += wsgi_req->write_pos;
// reset for the next write
wsgi_req->write_pos = 0;
return 0;
}
+1 -4
View File
@@ -141,10 +141,7 @@ int uwsgi_routing_func_sendfile(struct wsgi_request *wsgi_req, struct uwsgi_rout
if (uwsgi_response_add_content_type(wsgi_req, urfc->content_type, urfc->content_type_len)) goto end2;
}
ssize_t rlen = uwsgi_sendfile_do(wsgi_req->fd, fd, 0, st.st_size);
if (rlen > 0) {
wsgi_req->response_size += rlen;
}
uwsgi_simple_sendfile(wsgi_req, fd, 0, st.st_size);
end2:
close(fd);