From 1154aa8ddcfe50258946f97dfecf09bedbedf44a Mon Sep 17 00:00:00 2001 From: Unbit Date: Fri, 22 Nov 2013 18:46:07 +0100 Subject: [PATCH] added accepting hook --- core/uwsgi.c | 4 ++++ uwsgi.h | 1 + 2 files changed, 5 insertions(+) diff --git a/core/uwsgi.c b/core/uwsgi.c index 67147503..f7da5d8a 100644 --- a/core/uwsgi.c +++ b/core/uwsgi.c @@ -373,6 +373,7 @@ static struct uwsgi_option uwsgi_base_options[] = { {"hook-as-user-atexit", required_argument, 0, "run the specified hook before app exit and reload", uwsgi_opt_add_string_list, &uwsgi.hook_as_user_atexit, 0}, {"hook-pre-app", required_argument, 0, "run the specified hook before app loading", uwsgi_opt_add_string_list, &uwsgi.hook_pre_app, 0}, {"hook-post-app", required_argument, 0, "run the specified hook after app loading", uwsgi_opt_add_string_list, &uwsgi.hook_post_app, 0}, + {"hook-accepting", required_argument, 0, "run the specified hook after the app enters the accepting phase", uwsgi_opt_add_string_list, &uwsgi.hook_accepting, 0}, {"hook-as-vassal", required_argument, 0, "run the specified command before exec()ing the vassal", uwsgi_opt_add_string_list, &uwsgi.hook_as_vassal, 0}, {"hook-as-emperor", required_argument, 0, "run the specified command in the emperor after the vassal has been started", uwsgi_opt_add_string_list, &uwsgi.hook_as_emperor, 0}, @@ -3267,6 +3268,9 @@ void uwsgi_ignition() { } } + // run accepting hooks + uwsgi_hooks_run(uwsgi.hook_accepting, "accepting", 1); + if (uwsgi.loop) { void (*u_loop) (void) = uwsgi_get_loop(uwsgi.loop); if (!u_loop) { diff --git a/uwsgi.h b/uwsgi.h index 4f466f10..cfe5fb1b 100644 --- a/uwsgi.h +++ b/uwsgi.h @@ -1990,6 +1990,7 @@ struct uwsgi_server { struct uwsgi_string_list *hook_as_user_atexit; struct uwsgi_string_list *hook_pre_app; struct uwsgi_string_list *hook_post_app; + struct uwsgi_string_list *hook_accepting; struct uwsgi_string_list *hook_as_vassal; struct uwsgi_string_list *hook_as_emperor;