summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-08-19 12:58:45 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-08-19 12:58:45 +0200
commit192bc01d9e029d86a832a3673f844d78d2a5da96 (patch)
tree78896fa44335aa54d487edcf4da9ac2e819e90e0
parentac05d140f1bd5c94633598415b7a51f70562249b (diff)
downloadrsyslog-192bc01d9e029d86a832a3673f844d78d2a5da96.tar.gz
rsyslog-192bc01d9e029d86a832a3673f844d78d2a5da96.tar.xz
rsyslog-192bc01d9e029d86a832a3673f844d78d2a5da96.zip
undid non-correct experimental fix
I found out that the previous segfault fix did not correct the root cause of the problem. Thus, I can re-instantiate the more performance- optimal logic. In the next step, I'll merge in the real fix, so do NOT use this commit as code you actually run!
-rw-r--r--runtime/stream.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/runtime/stream.c b/runtime/stream.c
index 1b9beb5b..605a9771 100644
--- a/runtime/stream.c
+++ b/runtime/stream.c
@@ -628,8 +628,7 @@ static rsRetVal strmConstructFinalize(strm_t *pThis)
pthread_cond_init(&pThis->notEmpty, 0);
pthread_cond_init(&pThis->isEmpty, 0);
pThis->iCnt = pThis->iEnq = pThis->iDeq = 0;
- //for(i = 0 ; i < STREAM_ASYNC_NUMBUFS ; ++i) {
- for(i = 0 ; i < 1 ; ++i) { // HOTFIX!!!
+ for(i = 0 ; i < STREAM_ASYNC_NUMBUFS ; ++i) {
CHKmalloc(pThis->asyncBuf[i].pBuf = (uchar*) malloc(sizeof(uchar) * pThis->sIOBufSize));
}
pThis->pIOBuf = pThis->asyncBuf[0].pBuf;
@@ -845,10 +844,7 @@ dbgprintf("XXX: doAsyncWriteInternal: strm %p, len %ld\n", pThis, (long) lenBuf)
d_pthread_cond_wait(&pThis->notFull, &pThis->mut);
pThis->asyncBuf[pThis->iEnq % STREAM_ASYNC_NUMBUFS].lenBuf = lenBuf;
- pThis->asyncBuf[pThis->iEnq % STREAM_ASYNC_NUMBUFS].pBuf = pThis->pIOBuf;
- //pThis->pIOBuf = pThis->asyncBuf[++pThis->iEnq % STREAM_ASYNC_NUMBUFS].pBuf;
- ++pThis->iEnq;
- CHKmalloc(pThis->pIOBuf = (uchar*) malloc(sizeof(uchar) * pThis->sIOBufSize));
+ pThis->pIOBuf = pThis->asyncBuf[++pThis->iEnq % STREAM_ASYNC_NUMBUFS].pBuf;
pThis->bDoTimedWait = 0; /* everything written, no need to timeout partial buffer writes */
if(++pThis->iCnt == 1)
@@ -942,8 +938,6 @@ asyncWriterThread(void *pPtr)
iDeq = pThis->iDeq++ % STREAM_ASYNC_NUMBUFS;
doWriteInternal(pThis, pThis->asyncBuf[iDeq].pBuf, pThis->asyncBuf[iDeq].lenBuf);
// TODO: error check????? 2009-07-06
- free(pThis->asyncBuf[iDeq].pBuf);
- pThis->asyncBuf[iDeq].pBuf = NULL;
--pThis->iCnt;
if(pThis->iCnt < STREAM_ASYNC_NUMBUFS) {