mirror of
https://github.com/GOSTSec/ccminer
synced 2025-01-10 14:57:53 +00:00
api: allow -b <ip>, and set bind retry to 20sec
before, only -b <ip:port>, <port> or 0 (disable) was allowed easier to set -b 0.0.0.0 with default port
This commit is contained in:
parent
70743eb48d
commit
d09ec41251
4
api.cpp
4
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
|
||||
|
11
ccminer.cpp
11
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;
|
||||
|
Loading…
Reference in New Issue
Block a user