From 3141c15442cdb669d6e5a609011e655e2b1e8815 Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Mon, 11 Feb 2008 07:29:01 +0000 Subject: bugfix: suspended actions were not always properly resumed varmojfekoj provided the patch - many thanks! --- ChangeLog | 2 ++ syslogd.c | 13 ++++++++++++- tcpsyslog.c | 6 +++--- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 24370bc9..065956b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,8 @@ Version 2.0.2 STABLE (rgerhards), 2008-02-?? - added x-info field to rsyslogd startup/shutdown message. Hopefully points users to right location for further info (many don't even know they run rsyslog ;)) +- bugfix: suspended actions were not always properly resumed + varmojfekoj provided the patch - many thanks! --------------------------------------------------------------------------- Version 2.0.1 STABLE (rgerhards), 2008-01-24 - fixed a bug in integer conversion - but this function was never called, diff --git a/syslogd.c b/syslogd.c index 2858b863..cfe239ac 100644 --- a/syslogd.c +++ b/syslogd.c @@ -2491,7 +2491,7 @@ static rsRetVal callAction(msg_t *pMsg, action_t *pAction) */ if(pAction->f_pMsg != NULL) { if(pAction->f_prevcount > 0) - fprintlog(pAction); + CHKiRet(fprintlog(pAction)); /* we do not care about iRet above - I think it's right but if we have * some troubles, you know where to look at ;) -- rgerhards, 2007-08-01 */ @@ -3437,9 +3437,15 @@ DEFFUNC_llExecFunc(domarkActions) dbgprintf("flush %s: repeated %d times, %d sec.\n", modGetStateName(pAction->pMod), pAction->f_prevcount, repeatinterval[pAction->f_repeatcount]); + if(actionIsSuspended(pAction) && + (actionTryResume(pAction) != RS_RET_OK)) { + goto finalize_it; + } fprintlog(pAction); BACKOFF(pAction); } + +finalize_it: UnlockObj(pAction); return RS_RET_OK; /* we ignore errors, we can not do anything either way */ @@ -4109,9 +4115,14 @@ DEFFUNC_llExecFunc(freeSelectorsActions) /* flush any pending output */ if(pAction->f_prevcount) { + if(actionIsSuspended(pAction) && + (actionTryResume(pAction) != RS_RET_OK)) { + goto finalize_it; + } fprintlog(pAction); } +finalize_it: return RS_RET_OK; /* never fails ;) */ } diff --git a/tcpsyslog.c b/tcpsyslog.c index 311e4308..6b1c446c 100644 --- a/tcpsyslog.c +++ b/tcpsyslog.c @@ -1020,7 +1020,7 @@ int TCPSendCreateSocket(struct addrinfo *addrDest) return fd; } else { char errStr[1024]; - dbgprintf("create tcp connection failed, reason %s", + dbgprintf("create tcp connection failed, reason %s\n", rs_strerror_r(errno, errStr, sizeof(errStr))); } @@ -1032,12 +1032,12 @@ int TCPSendCreateSocket(struct addrinfo *addrDest) } else { char errStr[1024]; - dbgprintf("couldn't create send socket, reason %s", rs_strerror_r(errno, errStr, sizeof(errStr))); + dbgprintf("couldn't create send socket, reason %s\n", rs_strerror_r(errno, errStr, sizeof(errStr))); } r = r->ai_next; } - dbgprintf("no working socket could be obtained"); + dbgprintf("no working socket could be obtained\n"); return -1; } -- cgit v1.2.3