From d2ce28f4414424c25cd936decd2f30e2d9c2ab31 Mon Sep 17 00:00:00 2001 From: Unbit Date: Sun, 15 Dec 2013 19:28:20 +0100 Subject: [PATCH] added hostname hook --- core/hooks.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/hooks.c b/core/hooks.c index 49dde6d2..9ec21647 100644 --- a/core/hooks.c +++ b/core/hooks.c @@ -138,6 +138,10 @@ static int uwsgi_hook_write(char *arg) { return 0; } +static int uwsgi_hook_hostname(char *arg) { + return sethostname(arg, strlen(arg)); +} + static int uwsgi_hook_callint(char *arg) { char *space = strchr(arg, ' '); @@ -251,6 +255,8 @@ void uwsgi_register_base_hooks() { uwsgi_register_hook("callint", uwsgi_hook_callint); uwsgi_register_hook("callintret", uwsgi_hook_callintret); + uwsgi_register_hook("hostname", uwsgi_hook_hostname); + // for testing uwsgi_register_hook("exit", uwsgi_hook_exit); uwsgi_register_hook("print", uwsgi_hook_print);