mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-09 16:21:45 +00:00
Add an ability to pass listening socket to mongoose binary
This commit is contained in:
1 parent
b4a4b15835
commit
3a0a22f4cc
1 file changed
+8
@@ -449,6 +449,14 @@ static void start_mongoose(int argc, char *argv[]) {
|
|||||||
free(options[i + 1]);
|
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
|
// Setup signal handler: quit on Ctrl-C
|
||||||
signal(SIGTERM, signal_handler);
|
signal(SIGTERM, signal_handler);
|
||||||
signal(SIGINT, signal_handler);
|
signal(SIGINT, signal_handler);
|
||||||
|
|||||||
Reference in new issue
Block a user