mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-10 16:54:16 +07:00
Add an ability to pass listening socket to mongoose binary
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user