diff --git a/api.cpp b/api.cpp index 856fdae..f24c03e 100644 --- a/api.cpp +++ b/api.cpp @@ -750,8 +750,8 @@ static void api() break; else { if (!opt_quiet || opt_debug) - applog(LOG_WARNING, "API bind to port %d failed - trying again in 15sec", port); - sleep(15); + applog(LOG_WARNING, "API bind to port %d failed - trying again in 20sec", port); + sleep(20); } } else diff --git a/ccminer.cpp b/ccminer.cpp index f33aa54..bacb112 100644 --- a/ccminer.cpp +++ b/ccminer.cpp @@ -1734,7 +1734,7 @@ static void show_usage_and_exit(int status) static void parse_arg(int key, char *arg) { - char *p; + char *p = arg; int v, i; double d; @@ -1761,8 +1761,15 @@ static void parse_arg(int key, char *arg) } opt_api_listen = atoi(p + 1); } - else if (arg) + else if (arg && strstr(arg, ".")) { + /* ip only */ + free(opt_api_allow); + opt_api_allow = strdup(arg); + } + else if (arg) { + /* port or 0 to disable */ opt_api_listen = atoi(arg); + } break; case 'B': opt_background = true;