aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-05-14 21:16:19 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-05-14 21:16:19 +0200
commite4e2e55cb65f64198216df19e66f8efc13d0df08 (patch)
treee46a76155a5d898905fd8825fe6ddb36c5177068
parent95345a8913b41fa0c27bf1ba76d1b4f488345598 (diff)
downloaddabmux-e4e2e55cb65f64198216df19e66f8efc13d0df08.tar.gz
dabmux-e4e2e55cb65f64198216df19e66f8efc13d0df08.tar.bz2
dabmux-e4e2e55cb65f64198216df19e66f8efc13d0df08.zip
StatsServer coding style
-rw-r--r--src/StatsServer.cpp15
1 files changed, 5 insertions, 10 deletions
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);
}