From 310acaf4ccdb5eb7ef0d8e47f709288f3313ce8a Mon Sep 17 00:00:00 2001 From: "roberto@precise64" Date: Wed, 15 Feb 2012 21:28:12 +0100 Subject: [PATCH] do not inizialize request plugins if not needed --- uwsgi.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/uwsgi.c b/uwsgi.c index 2066d375..ba2d0130 100644 --- a/uwsgi.c +++ b/uwsgi.c @@ -2248,9 +2248,12 @@ skipzero: } } - for (i = 0; i < 0xff; i++) { - if (uwsgi.p[i]->post_init) { - uwsgi.p[i]->post_init(); + // again check for workers/sockets... + if (uwsgi.sockets || uwsgi.master_process || uwsgi.no_server || uwsgi.command_mode) { + for (i = 0; i < 0xff; i++) { + if (uwsgi.p[i]->post_init) { + uwsgi.p[i]->post_init(); + } } } @@ -2273,9 +2276,12 @@ skipzero: pthread_mutex_init(&uwsgi.lock_static, NULL); - for (i = 0; i < 0xFF; i++) { - if (uwsgi.p[i]->enable_threads) - uwsgi.p[i]->enable_threads(); + // again check for workers/sockets... + if (uwsgi.sockets || uwsgi.master_process || uwsgi.no_server || uwsgi.command_mode) { + for (i = 0; i < 0xFF; i++) { + if (uwsgi.p[i]->enable_threads) + uwsgi.p[i]->enable_threads(); + } } } #endif