Change tabs to spaces to satisfy travis.

develop
Japa Illo 2017-10-04 09:48:12 +05:30
parent bb1eb0b48a
commit 3c5483df03
2 changed files with 34 additions and 34 deletions

@ -284,10 +284,10 @@ void ServerConnection::threadFn()
}
else
{
if (((fn->flags & SF_ALLOW_REMOTE) != SF_ALLOW_REMOTE) && strcmp(socket->GetClientAddr(), "127.0.0.1") != 0)
{
stream.printerr("In call to %s: forbidden host: %s\n", fn->name, socket->GetClientAddr());
}
if (((fn->flags & SF_ALLOW_REMOTE) != SF_ALLOW_REMOTE) && strcmp(socket->GetClientAddr(), "127.0.0.1") != 0)
{
stream.printerr("In call to %s: forbidden host: %s\n", fn->name, socket->GetClientAddr());
}
else if (!fn->in()->ParseFromArray(buf.get(), header.size))
{
stream.printerr("In call to %s: could not decode input args.\n", fn->name);
@ -379,33 +379,33 @@ bool ServerMain::listen(int port)
socket->Initialize();
bool allow_remote = false;
std::string filename("dfhack-config/remote-server.cfg");
std::ifstream configFile(filename);
if (configFile.is_open())
{
std::string line;
while (std::getline(configFile, line))
{
if (line.compare(0, 1, "#") == 0)
continue;
if (line.compare(0, 24, "allow-remote-connections") == 0)
{
allow_remote = (line.compare(25, std::string::npos, "true") == 0);
}
}
}
if (allow_remote)
{
if (!socket->Listen(NULL, port))
return false;
}
else
{
if (!socket->Listen("127.0.0.1", port))
return false;
}
bool allow_remote = false;
std::string filename("dfhack-config/remote-server.cfg");
std::ifstream configFile(filename);
if (configFile.is_open())
{
std::string line;
while (std::getline(configFile, line))
{
if (line.compare(0, 1, "#") == 0)
continue;
if (line.compare(0, 24, "allow-remote-connections") == 0)
{
allow_remote = (line.compare(25, std::string::npos, "true") == 0);
}
}
}
if (allow_remote)
{
if (!socket->Listen(NULL, port))
return false;
}
else
{
if (!socket->Listen("127.0.0.1", port))
return false;
}
thread = new tthread::thread(threadFn, this);
thread->detach();

@ -47,9 +47,9 @@ namespace DFHack
// Don't automatically suspend the core around the call.
// The function is supposed to manage locking itself.
SF_DONT_SUSPEND = 2,
// The function is considered safe to call from a remote computer.
// All other functions cannot be allowed for security reasons.
SF_ALLOW_REMOTE = 4
// The function is considered safe to call from a remote computer.
// All other functions cannot be allowed for security reasons.
SF_ALLOW_REMOTE = 4
};
class DFHACK_EXPORT ServerFunctionBase : public RPCFunctionBase {