summaryrefslogtreecommitdiffstats
path: root/runtime/stream.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-06-23 17:23:28 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-06-23 17:23:28 +0200
commita3e512f65f411bd0a4853d3dca9a3f3e6593e490 (patch)
treee68d6057b43388dccfd0c5c930619e977d26e856 /runtime/stream.c
parent06e59df5ded6fa51becb3abe14430027c72f1088 (diff)
parentb2fa740b9ab5fb9e85309b3307f3fca21f625ab1 (diff)
downloadrsyslog-a3e512f65f411bd0a4853d3dca9a3f3e6593e490.tar.gz
rsyslog-a3e512f65f411bd0a4853d3dca9a3f3e6593e490.tar.xz
rsyslog-a3e512f65f411bd0a4853d3dca9a3f3e6593e490.zip
Merge branch 'omfile' into v5-devel
Conflicts: runtime/rsyslog.h
Diffstat (limited to 'runtime/stream.c')
-rw-r--r--runtime/stream.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/runtime/stream.c b/runtime/stream.c
index a05f4c9b..67941062 100644
--- a/runtime/stream.c
+++ b/runtime/stream.c
@@ -75,6 +75,7 @@ flushApc(void *param1, void __attribute__((unused)) *param2)
BEGINfunc
BEGIN_MTX_PROTECTED_OPERATIONS_UNCOND(&pThis->mut);
strmFlush(pThis);
+ pThis->apcRequested = 0;
END_MTX_PROTECTED_OPERATIONS_UNCOND(&pThis->mut);
ENDfunc
}
@@ -1003,12 +1004,16 @@ scheduleFlushRequest(strm_t *pThis)
apc_t *pApc;
DEFiRet;
- CHKiRet(apc.CancelApc(pThis->apcID));
+ if(!pThis->apcRequested) {
+ /* we do an request only if none is yet pending */
+ pThis->apcRequested = 1;
+ // TODO: find similar thing later CHKiRet(apc.CancelApc(pThis->apcID));
dbgprintf("XXX: requesting to add apc!\n");
- CHKiRet(apc.Construct(&pApc));
- CHKiRet(apc.SetProcedure(pApc, (void (*)(void*, void*))flushApc));
- CHKiRet(apc.SetParam1(pApc, pThis));
- CHKiRet(apc.ConstructFinalize(pApc, &pThis->apcID));
+ CHKiRet(apc.Construct(&pApc));
+ CHKiRet(apc.SetProcedure(pApc, (void (*)(void*, void*))flushApc));
+ CHKiRet(apc.SetParam1(pApc, pThis));
+ CHKiRet(apc.ConstructFinalize(pApc, &pThis->apcID));
+ }
finalize_it:
RETiRet;