From: <st...@us...> - 2013-08-05 12:01:48
|
Revision: 7253 http://sourceforge.net/p/xymon/code/7253 Author: storner Date: 2013-08-05 12:01:45 +0000 (Mon, 05 Aug 2013) Log Message: ----------- extcombo: Dont overflow the backfeed messagequeue max-size Modified Paths: -------------- branches/4.3.13/lib/sendmsg.c Modified: branches/4.3.13/lib/sendmsg.c =================================================================== --- branches/4.3.13/lib/sendmsg.c 2013-08-05 11:54:11 UTC (rev 7252) +++ branches/4.3.13/lib/sendmsg.c 2013-08-05 12:01:45 UTC (rev 7253) @@ -796,11 +796,18 @@ void combo_add(strbuffer_t *buf) { - /* Check if there is room for the message + 2 newlines */ - if (maxmsgspercombo && (xymonmsgqueued >= maxmsgspercombo)) { - /* Nope ... flush buffer */ - combo_flush(); + if (combo_is_local) { + /* Check if message fits into the backfeed message buffer */ + if ( (STRBUFLEN(xymonmsg) + STRBUFLEN(buf)) >= shbufsz(C_FEEDBACK_QUEUE)) { + combo_flush(); + } } + else { + /* Check if there is room for the message + 2 newlines */ + if (maxmsgspercombo && (xymonmsgqueued >= maxmsgspercombo)) { + combo_flush(); + } + } addtostrbuffer(xymonmsg, buf); combooffsets[++xymonmsgqueued] = STRBUFLEN(xymonmsg); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |