Disable the internal webserver at build time.

This commit is contained in:
Oliver Jowett 2016-07-10 11:56:31 +01:00
parent 9a10ef4886
commit e4ceea33da
5 changed files with 30 additions and 2 deletions

View file

@ -150,7 +150,9 @@ void modesInitConfig(void) {
Modes.net_output_sbs_ports = strdup("30003");
Modes.net_input_beast_ports = strdup("30004,30104");
Modes.net_output_beast_ports = strdup("30005");
#ifdef ENABLE_WEBSERVER
Modes.net_http_ports = strdup("8080");
#endif
Modes.interactive_rows = getTermRows();
Modes.interactive_display_ttl = MODES_INTERACTIVE_DISPLAY_TTL;
Modes.html_dir = HTMLPATH;
@ -680,7 +682,9 @@ void showHelp(void) {
"--modeac Enable decoding of SSR Modes 3/A & 3/C\n"
"--net-only Enable just networking, no RTL device or file used\n"
"--net-bind-address <ip> IP address to bind to (default: Any; Use 127.0.0.1 for private)\n"
#ifdef ENABLE_WEBSERVER
"--net-http-port <ports> HTTP server ports (default: 8080)\n"
#endif
"--net-ri-port <ports> TCP raw input listen ports (default: 30001)\n"
"--net-ro-port <ports> TCP raw output listen ports (default: 30002)\n"
"--net-sbs-port <ports> TCP BaseStation output listen ports (default: 30003)\n"
@ -993,8 +997,14 @@ int main(int argc, char **argv) {
free(Modes.net_bind_address);
Modes.net_bind_address = strdup(argv[++j]);
} else if (!strcmp(argv[j],"--net-http-port") && more) {
#ifdef ENABLE_WEBSERVER
free(Modes.net_http_ports);
Modes.net_http_ports = strdup(argv[++j]);
#else
if (strcmp(argv[++j], "0")) {
fprintf(stderr, "warning: --net-http-port not supported in this build, option ignored.\n");
}
#endif
} else if (!strcmp(argv[j],"--net-sbs-port") && more) {
free(Modes.net_output_sbs_ports);
Modes.net_output_sbs_ports = strdup(argv[++j]);