From 3c5483df03db4d301681bcbc8b5087d54feffb9e Mon Sep 17 00:00:00 2001 From: Japa Illo Date: Wed, 4 Oct 2017 09:48:12 +0530 Subject: [PATCH] Change tabs to spaces to satisfy travis. --- library/RemoteServer.cpp | 62 +++++++++++++++++----------------- library/include/RemoteServer.h | 6 ++-- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/library/RemoteServer.cpp b/library/RemoteServer.cpp index 4a4787006..05fd141f2 100644 --- a/library/RemoteServer.cpp +++ b/library/RemoteServer.cpp @@ -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(); diff --git a/library/include/RemoteServer.h b/library/include/RemoteServer.h index d01eb0a19..514f91250 100644 --- a/library/include/RemoteServer.h +++ b/library/include/RemoteServer.h @@ -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 {