added accepting hook

This commit is contained in:
Unbit
2013-11-22 18:46:07 +01:00
parent 3371dd2f94
commit 1154aa8ddc
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -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) {
+1
View File
@@ -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;