mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-09-01 02:35:03 +00:00
fixed offload to thread
This commit is contained in:
+4
-2
@@ -1911,7 +1911,10 @@ int uwsgi_real_file_serve(struct wsgi_request *wsgi_req, char *real_filename, si
|
||||
|
||||
// Ok, the file must be transferred from uWSGI
|
||||
if (wsgi_req->socket->can_offload) {
|
||||
if (!uwsgi_offload_request_do(wsgi_req, real_filename, st->st_size)) goto done;
|
||||
if (!uwsgi_offload_request_do(wsgi_req, real_filename, st->st_size)) {
|
||||
wsgi_req->status = -30;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
wsgi_req->sendfile_fd = open(real_filename, O_RDONLY);
|
||||
@@ -1920,7 +1923,6 @@ int uwsgi_real_file_serve(struct wsgi_request *wsgi_req, char *real_filename, si
|
||||
close(wsgi_req->sendfile_fd);
|
||||
}
|
||||
|
||||
done:
|
||||
wsgi_req->status = 200;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@ int uwsgi_offload_request_do(struct wsgi_request *wsgi_req, char *filename, size
|
||||
uor.pos = 0;
|
||||
uor.len = len;
|
||||
uor.written = 0;
|
||||
uor.buf = NULL;
|
||||
uor.prev = NULL;
|
||||
uor.next = NULL;
|
||||
|
||||
|
||||
@@ -2221,7 +2221,9 @@ int uwsgi_start(void *v_argv) {
|
||||
#endif
|
||||
|
||||
// users of the --loop option should know what they are doing... really...
|
||||
#ifndef UWSGI_DEBUG
|
||||
if (uwsgi.loop) goto unsafe;
|
||||
#endif
|
||||
|
||||
#ifdef UWSGI_UDP
|
||||
if (!uwsgi.sockets && !ushared->gateways_cnt && !uwsgi.no_server && !uwsgi.udp_socket && !uwsgi.emperor && !uwsgi.command_mode) {
|
||||
@@ -2246,7 +2248,9 @@ int uwsgi_start(void *v_argv) {
|
||||
uwsgi.to_hell = 1;
|
||||
}
|
||||
|
||||
#ifndef UWSGI_DEBUG
|
||||
unsafe:
|
||||
#endif
|
||||
|
||||
#ifdef UWSGI_DEBUG
|
||||
struct uwsgi_socket *uwsgi_sock = uwsgi.sockets;
|
||||
|
||||
Reference in New Issue
Block a user