mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-06 13:41:28 +00:00
use the right sendfile abstraction
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user