From e4e2e55cb65f64198216df19e66f8efc13d0df08 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Wed, 14 May 2014 21:16:19 +0200 Subject: StatsServer coding style --- src/StatsServer.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/StatsServer.cpp b/src/StatsServer.cpp index 676c832..25e1b76 100644 --- a/src/StatsServer.cpp +++ b/src/StatsServer.cpp @@ -245,8 +245,7 @@ void StatsServer::serverThread() m_running = true; - while (m_running) - { + while (m_running) { socklen_t cli_addr_len = sizeof(cli_addr); /* Accept actual connection from the client */ @@ -278,26 +277,22 @@ void StatsServer::serverThread() continue; } - if (strcmp(buffer, "config\n") == 0) - { + if (strcmp(buffer, "config\n") == 0) { boost::mutex::scoped_lock lock(m_mutex); std::string json = getConfigJSON(); n = write(accepted_sock, json.c_str(), json.size()); } - else if (strcmp(buffer, "values\n") == 0) - { + else if (strcmp(buffer, "values\n") == 0) { boost::mutex::scoped_lock lock(m_mutex); std::string json = getValuesJSON(); n = write(accepted_sock, json.c_str(), json.size()); } - else if (strcmp(buffer, "state\n") == 0) - { + else if (strcmp(buffer, "state\n") == 0) { boost::mutex::scoped_lock lock(m_mutex); std::string json = getStateJSON(); n = write(accepted_sock, json.c_str(), json.size()); } - else - { + else { int len = snprintf(buffer, 256, "Invalid command\n"); n = write(accepted_sock, buffer, len); } -- cgit v1.2.3