From 6ec3b05ce5168e813018c19f61f5285890310b46 Mon Sep 17 00:00:00 2001 From: "roberto@precise64" Date: Sun, 13 May 2012 19:49:00 +0200 Subject: [PATCH] fixed uwsgi signals in async mode --- async.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/async.c b/async.c index 3ed5a408..507bdf2b 100644 --- a/async.c +++ b/async.c @@ -214,6 +214,7 @@ void *async_loop(void *arg1) { if (uwsgi.signal_socket > -1) { event_queue_add_fd_read(uwsgi.async_queue, uwsgi.signal_socket); + event_queue_add_fd_read(uwsgi.async_queue, uwsgi.my_signal_socket); } // set a default request manager @@ -253,6 +254,12 @@ void *async_loop(void *arg1) { // manage events interesting_fd = event_queue_interesting_fd(events, i); + if (uwsgi.signal_socket > -1 && (interesting_fd == uwsgi.signal_socket || interesting_fd == uwsgi.my_signal_socket)) { + uwsgi_receive_signal(interesting_fd, "worker", uwsgi.mywid); + continue; + } + + is_a_new_connection = 0; // new request coming in ? @@ -271,7 +278,7 @@ void *async_loop(void *arg1) { uwsgi_log("async queue is full !!!\n"); last_now = now; } - break;; + break; } wsgi_req_setup(uwsgi.wsgi_req, uwsgi.wsgi_req->async_id, uwsgi_sock );