mirror of https://github.com/Icinga/icinga2.git
Fixed crash bug in Timer::StopAllTimers
Fixed compilation error with gcc (in connectionmanager.cpp) Use unformatted JSON strings in release builds
This commit is contained in:
parent
1ebda64e75
commit
af1edb7d94
|
@ -62,7 +62,8 @@ void Timer::CallExpiredTimers(void)
|
||||||
void Timer::StopAllTimers(void)
|
void Timer::StopAllTimers(void)
|
||||||
{
|
{
|
||||||
for (list<Timer::WeakRefType>::iterator i = Timers.begin(); i != Timers.end(); ) {
|
for (list<Timer::WeakRefType>::iterator i = Timers.begin(); i != Timers.end(); ) {
|
||||||
Timer::RefType timer = Timer::RefType(*i);
|
Timer::RefType timer = i->lock();
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
if (timer == NULL)
|
if (timer == NULL)
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
#include "i2-jsonrpc.h"
|
#include "i2-jsonrpc.h"
|
||||||
|
|
||||||
using namespace icinga;
|
using namespace icinga;
|
||||||
using std::map;
|
|
||||||
using std::function;
|
|
||||||
|
|
||||||
void ConnectionManager::BindServer(JsonRpcServer::RefType server)
|
void ConnectionManager::BindServer(JsonRpcServer::RefType server)
|
||||||
{
|
{
|
||||||
|
|
|
@ -59,8 +59,16 @@ cJSON *Netstring::ReadJSONFromFIFO(FIFO::RefType fifo)
|
||||||
|
|
||||||
void Netstring::WriteJSONToFIFO(FIFO::RefType fifo, cJSON *object)
|
void Netstring::WriteJSONToFIFO(FIFO::RefType fifo, cJSON *object)
|
||||||
{
|
{
|
||||||
char *json = cJSON_Print(object);
|
char *json;
|
||||||
size_t len = strlen(json);
|
size_t len;
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
json = cJSON_Print(object);
|
||||||
|
#else /* _DEBUG */
|
||||||
|
json = cJSON_PrintUnformatted(object);
|
||||||
|
#endif /* _DEBUG */
|
||||||
|
|
||||||
|
len = strlen(json);
|
||||||
char strLength[50];
|
char strLength[50];
|
||||||
sprintf(strLength, "%lu", (unsigned long)len);
|
sprintf(strLength, "%lu", (unsigned long)len);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue