summaryrefslogtreecommitdiffstats
path: root/queue.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-01-10 09:08:13 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-01-10 09:08:13 +0000
commit79040541b70e95f0f00add4c9cafa08e9c411d79 (patch)
tree0092425a37b05c5035a3529d5441eae7b42a54ad /queue.c
parent24c125cfc3032e6269e6e5de91c72c91508adde0 (diff)
downloadrsyslog-79040541b70e95f0f00add4c9cafa08e9c411d79.tar.gz
rsyslog-79040541b70e95f0f00add4c9cafa08e9c411d79.tar.xz
rsyslog-79040541b70e95f0f00add4c9cafa08e9c411d79.zip
added buffered output to stream class
Diffstat (limited to 'queue.c')
-rw-r--r--queue.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/queue.c b/queue.c
index 272161a9..6ff4358f 100644
--- a/queue.c
+++ b/queue.c
@@ -205,12 +205,14 @@ static rsRetVal qConstructDisk(queue_t *pThis)
CHKiRet(strmConstruct(&pThis->tVars.disk.pWrite));
CHKiRet(strmSetDir(pThis->tVars.disk.pWrite, pszSpoolDirectory, strlen((char*)pszSpoolDirectory)));
CHKiRet(strmSetiMaxFiles(pThis->tVars.disk.pWrite, 10000000));
+ CHKiRet(strmSettOperationsMode(pThis->tVars.disk.pWrite, STREAMMODE_WRITE));
CHKiRet(strmConstructFinalize(pThis->tVars.disk.pWrite));
CHKiRet(strmConstruct(&pThis->tVars.disk.pRead));
CHKiRet(strmSetbDeleteOnClose(pThis->tVars.disk.pRead, 1));
CHKiRet(strmSetDir(pThis->tVars.disk.pRead, pszSpoolDirectory, strlen((char*)pszSpoolDirectory)));
CHKiRet(strmSetiMaxFiles(pThis->tVars.disk.pRead, 10000000));
+ CHKiRet(strmSettOperationsMode(pThis->tVars.disk.pRead, STREAMMODE_READ));
CHKiRet(strmConstructFinalize(pThis->tVars.disk.pRead));
finalize_it:
@@ -240,10 +242,11 @@ static rsRetVal qAddDisk(queue_t *pThis, void* pUsr)
assert(pThis != NULL);
- CHKiRet(strmOpenFile(pThis->tVars.disk.pWrite, O_RDWR|O_CREAT|O_TRUNC, 0600)); // TODO: open modes!
+ //CHKiRet(strmOpenFile(pThis->tVars.disk.pWrite, O_RDWR|O_CREAT|O_TRUNC, 0600)); // TODO: open modes!
CHKiRet((objSerialize(pUsr))(pUsr, &pCStr));
CHKiRet(strmWrite(pThis->tVars.disk.pWrite, rsCStrGetBufBeg(pCStr), rsCStrLen(pCStr)));
+ CHKiRet(strmFlush(pThis->tVars.disk.pWrite));
finalize_it:
return iRet;