diff --git a/base/timer.cpp b/base/timer.cpp index 885bb0693..6ff6e191f 100644 --- a/base/timer.cpp +++ b/base/timer.cpp @@ -62,7 +62,8 @@ void Timer::CallExpiredTimers(void) void Timer::StopAllTimers(void) { for (list::iterator i = Timers.begin(); i != Timers.end(); ) { - Timer::RefType timer = Timer::RefType(*i); + Timer::RefType timer = i->lock(); + i++; if (timer == NULL) diff --git a/jsonrpc/connectionmanager.cpp b/jsonrpc/connectionmanager.cpp index 98787f35d..3d23299c9 100644 --- a/jsonrpc/connectionmanager.cpp +++ b/jsonrpc/connectionmanager.cpp @@ -1,8 +1,6 @@ #include "i2-jsonrpc.h" using namespace icinga; -using std::map; -using std::function; void ConnectionManager::BindServer(JsonRpcServer::RefType server) { diff --git a/jsonrpc/netstring.cpp b/jsonrpc/netstring.cpp index 7b0885041..05e6227ce 100644 --- a/jsonrpc/netstring.cpp +++ b/jsonrpc/netstring.cpp @@ -59,8 +59,16 @@ cJSON *Netstring::ReadJSONFromFIFO(FIFO::RefType fifo) void Netstring::WriteJSONToFIFO(FIFO::RefType fifo, cJSON *object) { - char *json = cJSON_Print(object); - size_t len = strlen(json); + char *json; + size_t len; + +#ifdef _DEBUG + json = cJSON_Print(object); +#else /* _DEBUG */ + json = cJSON_PrintUnformatted(object); +#endif /* _DEBUG */ + + len = strlen(json); char strLength[50]; sprintf(strLength, "%lu", (unsigned long)len);