diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-10 09:08:13 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-01-10 09:08:13 +0000 |
commit | 79040541b70e95f0f00add4c9cafa08e9c411d79 (patch) | |
tree | 0092425a37b05c5035a3529d5441eae7b42a54ad /queue.c | |
parent | 24c125cfc3032e6269e6e5de91c72c91508adde0 (diff) | |
download | rsyslog-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.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; |