From 3a0a22f4ccdb7dc45f1f35966d17a061e2ae4773 Mon Sep 17 00:00:00 2001 From: Sergey Lyubka Date: Thu, 26 Dec 2013 11:37:52 +0000 Subject: [PATCH] Add an ability to pass listening socket to mongoose binary --- build/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build/main.c b/build/main.c index 7daf7ef6..50b78025 100644 --- a/build/main.c +++ b/build/main.c @@ -449,6 +449,14 @@ static void start_mongoose(int argc, char *argv[]) { free(options[i + 1]); } + // Add an ability to pass listening socket to mongoose + { + const char *env = getenv("MONGOOSE_LISTENING_SOCKET"); + if (env != NULL && atoi(env) > 0 ) { + mg_set_listening_socket(server, atoi(env)); + } + } + // Setup signal handler: quit on Ctrl-C signal(SIGTERM, signal_handler); signal(SIGINT, signal_handler);