mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-01-18 18:56:24 +00:00
command bus fix
This commit is contained in:
parent
6fdb360e2a
commit
1c555e4b96
4
main.cpp
4
main.cpp
@ -116,9 +116,9 @@ static void printHelp(FILE *out,const char *cn)
|
||||
|
||||
static void _CBresultHandler(void *arg,const char *line)
|
||||
{
|
||||
if ((line)&&(line[0]))
|
||||
if ((line)&&(line[0])) {
|
||||
fprintf(stdout,"%s"ZT_EOL_S,line);
|
||||
else *((bool *)arg) = true;
|
||||
} else *((bool *)arg) = true;
|
||||
}
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
|
@ -184,7 +184,7 @@ void NodeConfig::_doCommand(IpcConnection *ipcc,const char *commandLine)
|
||||
|
||||
if ((cmd.empty())||(cmd[0] == "help")) {
|
||||
ipcc->printf("200 help help"ZT_EOL_S);
|
||||
ipcc->printf("200 auth token"ZT_EOL_S);
|
||||
ipcc->printf("200 help auth <token>"ZT_EOL_S);
|
||||
ipcc->printf("200 help info"ZT_EOL_S);
|
||||
ipcc->printf("200 help listpeers"ZT_EOL_S);
|
||||
ipcc->printf("200 help listnetworks"ZT_EOL_S);
|
||||
@ -196,8 +196,8 @@ void NodeConfig::_doCommand(IpcConnection *ipcc,const char *commandLine)
|
||||
if ((cmd.size() > 1)&&(_authToken == cmd[1])) {
|
||||
Mutex::Lock _l(_connections_m);
|
||||
_connections[ipcc] = true;
|
||||
ipcc->printf("200 OK"ZT_EOL_S);
|
||||
} else ipcc->printf("403 auth failed"ZT_EOL_S);
|
||||
ipcc->printf("200 auth OK"ZT_EOL_S);
|
||||
} else ipcc->printf("403 auth FAILED"ZT_EOL_S);
|
||||
} else {
|
||||
{
|
||||
Mutex::Lock _l(_connections_m);
|
||||
|
Loading…
Reference in New Issue
Block a user