diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2007-07-26 12:07:23 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2007-07-26 12:07:23 +0000 |
commit | 54669873b0469aa69a4c9f88bcf88470218082f8 (patch) | |
tree | 1042b7096d3332dc92abbb8c4ee9fdc0af1f7e55 /syslogd.c | |
parent | 1904ce3f5aa11f190c881ccda650c1f464fe9271 (diff) | |
download | rsyslog-54669873b0469aa69a4c9f88bcf88470218082f8.tar.gz rsyslog-54669873b0469aa69a4c9f88bcf88470218082f8.tar.bz2 rsyslog-54669873b0469aa69a4c9f88bcf88470218082f8.zip |
- implemented needUDPSocket() interface
- replaced (mis) use of f_prevcount in omfwd.c -> now data element in
instance data is used for retry counting
- removed f->f_type from syslogd.c, omfwd.c
- removed f->f_file from omfwd.c, omfile.c
- f->f_flags is gone away
Diffstat (limited to 'syslogd.c')
-rw-r--r-- | syslogd.c | 21 |
1 files changed, 8 insertions, 13 deletions
@@ -3262,8 +3262,8 @@ rsRetVal fprintlog(register selector_t *f) if(iRet == RS_RET_DISABLE_ACTION) f->bEnabled = 0; /* that's it... */ - if (f->f_type != F_FORW_UNKN) - f->f_prevcount = 0; + if(iRet == RS_RET_OK) + f->f_prevcount = 0; /* message process, so we start a new cycle */ if(pMsgSave != NULL) { /* we had saved the original message pointer. That was @@ -4038,14 +4038,13 @@ static void freeSelectors(void) f = Files; while (f != NULL) { /* flush any pending output */ - /* TODO: the output module must handle this internally in the - * future - implement it when moving f_type out of selector_t - * rgerhards, 2007-07-24 - */ - if(f->f_type != F_FORW_UNKN && f->f_prevcount) { + if(f->f_prevcount) { fprintlog(f); } + /* free the action instances */ + f->pMod->freeInstance(f, f->pModData); + /* free iovec if it was allocated */ if(f->f_iov != NULL) { if(f->f_bMustBeFreed != NULL) { @@ -4059,9 +4058,6 @@ static void freeSelectors(void) if (f->f_psziov != NULL) free(f->f_psziov); - /* free the action instances */ - f->pMod->freeInstance(f, f->pModData); - if(f->f_pMsg != NULL) MsgDestruct(f->f_pMsg); /* done with this entry, we now need to delete itself */ @@ -4247,7 +4243,7 @@ static void init() nextp->f_next = f; } nextp = f; - if (f->f_type == F_FORW || f->f_type == F_FORW_SUSP || f->f_type == F_FORW_UNKN) { + if(f->pMod->needUDPSocket(f->pModData) == RS_RET_TRUE) { Forwarding++; } } @@ -4560,7 +4556,6 @@ static rsRetVal cflineProcessTradPRIFilter(uchar **pline, register selector_t *f */ for (i = 0; i <= LOG_NFACILITIES; i++) { f->f_filterData.f_pmask[i] = TABLE_NOPRI; - f->f_flags = 0; } /* scan through the list of selectors */ @@ -5368,7 +5363,7 @@ static void mainloop(void) rsRetVal iRet; for (f = Files; f != NULL ; f = f->f_next) { if(f->pMod->getWriteFDForSelect(f, f->pModData, &fdMod) == RS_RET_OK) { - if(FD_ISSET(f->f_file, &writefds)) { + if(FD_ISSET(fdMod, &writefds)) { if((iRet = f->pMod->onSelectReadyWrite(f, f->pModData)) != RS_RET_OK) { dprintf("error %d from onSelectReadyWrite() - continuing\n", iRet); } |