From e9e9ff3fa90fe06b45641d653a7e252097e18896 Mon Sep 17 00:00:00 2001 From: bel Date: Fri, 7 Mar 2014 19:22:25 +0100 Subject: [PATCH] Allow to specify a title for the service, so an admin may distinguish two instances of civetweb on the same system --- src/main.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/main.c b/src/main.c index 90f2638e..c3baaef3 100644 --- a/src/main.c +++ b/src/main.c @@ -203,6 +203,11 @@ static int set_option(char **options, const char *name, const char *value) int i, type; const struct mg_option *default_options = mg_get_valid_options(); + if (0==strcmp(name, "title")) { + /* This option is evaluated by main.c, not civetweb.c - just skip it and return OK */ + return 1; + } + type = CONFIG_TYPE_UNKNOWN; for (i = 0; default_options[i].name != 0; i++) { if (!strcmp(default_options[i].name, name)) { @@ -359,12 +364,19 @@ static void process_command_line_arguments(char *argv[], char **options) } } -static void init_server_name(void) +static void init_server_name(int argc, const char *argv[]) { + int i; assert((strlen(mg_version())+12)