~ubuntu-branches/ubuntu/lucid/rsyslog/lucid-updates

« back to all changes in this revision

Viewing changes to tcps_sess.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Biebl
  • Date: 2009-06-23 12:12:43 UTC
  • mfrom: (1.1.11 upstream) (3.2.8 sid)
  • Revision ID: james.westby@ubuntu.com-20090623121243-d2fejarzidywnn17
Tags: 4.2.0-1
* New upstream release of the now stable v4 branch.
  - Fix warnings when /etc/rsyslog.d/ is empty. Closes: #530228
* debian/patches/imudp_multiple_udp_sockets.patch
  - Removed, merged upstream.
* debian/rsyslog.default
  - Set default compat mode to '4'.
* debian/rsyslog.logcheck.ignore.server
  - Update logcheck rules files to also ignore rsyslogd and imklog stop
    messages.
* debian/control
  - Bump Standards-Version to 3.8.2. No further changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 */
30
30
#include "config.h"
31
31
#include <stdlib.h>
 
32
#include <string.h>
32
33
#include <assert.h>
33
34
#include <errno.h>
34
35
#include <ctype.h>
42
43
#include "obj.h"
43
44
#include "errmsg.h"
44
45
#include "netstrm.h"
 
46
#include "msg.h"
45
47
 
46
48
 
47
49
/* static data */
229
231
                 * this case.
230
232
                 */
231
233
                dbgprintf("Extra data at end of stream in legacy syslog/tcp message - processing\n");
232
 
                parseAndSubmitMessage(pThis->fromHost, pThis->fromHostIP, pThis->pMsg, pThis->iMsg, MSG_PARSE_HOSTNAME,
233
 
                                      NOFLAG, eFLOWCTL_LIGHT_DELAY, NULL); /* TODO: add real InputName */
 
234
                parseAndSubmitMessage(pThis->fromHost, pThis->fromHostIP, pThis->pMsg, pThis->iMsg,
 
235
                                      PARSE_HOSTNAME, eFLOWCTL_LIGHT_DELAY, pThis->pSrv->pszInputName, NULL, 0);
234
236
                pThis->bAtStrtOfFram = 1;
235
237
        }
236
238
 
313
315
                        /* emergency, we now need to flush, no matter if we are at end of message or not... */
314
316
                        dbgprintf("error: message received is larger than max msg size, we split it\n");
315
317
                        parseAndSubmitMessage(pThis->fromHost, pThis->fromHostIP, pThis->pMsg, pThis->iMsg,
316
 
                                              MSG_PARSE_HOSTNAME, NOFLAG, eFLOWCTL_LIGHT_DELAY, NULL); /* TODO: add real InputName */
 
318
                                              PARSE_HOSTNAME, eFLOWCTL_LIGHT_DELAY, pThis->pSrv->pszInputName, NULL, 0);
317
319
                        pThis->iMsg = 0;
318
320
                        /* we might think if it is better to ignore the rest of the
319
321
                         * message than to treat it as a new one. Maybe this is a good
322
324
                         */
323
325
                }
324
326
 
325
 
                if(c == '\n' && pThis->eFraming == TCP_FRAMING_OCTET_STUFFING) { /* record delemiter? */
 
327
                if((   (c == '\n')
 
328
                   || ((pThis->pSrv->addtlFrameDelim != TCPSRV_NO_ADDTL_DELIMITER) && (c == pThis->pSrv->addtlFrameDelim))
 
329
                   ) && pThis->eFraming == TCP_FRAMING_OCTET_STUFFING) { /* record delimiter? */
326
330
                        parseAndSubmitMessage(pThis->fromHost, pThis->fromHostIP, pThis->pMsg, pThis->iMsg,
327
 
                                              MSG_PARSE_HOSTNAME, NOFLAG, eFLOWCTL_LIGHT_DELAY, NULL); /* TODO: add real InputName */
 
331
                                              PARSE_HOSTNAME, eFLOWCTL_LIGHT_DELAY, pThis->pSrv->pszInputName, NULL, 0);
328
332
                        pThis->iMsg = 0;
329
333
                        pThis->inputState = eAtStrtFram;
330
334
                } else {
343
347
                        if(pThis->iOctetsRemain < 1) {
344
348
                                /* we have end of frame! */
345
349
                                parseAndSubmitMessage(pThis->fromHost, pThis->fromHostIP, pThis->pMsg, pThis->iMsg,
346
 
                                              MSG_PARSE_HOSTNAME, NOFLAG, eFLOWCTL_LIGHT_DELAY, NULL); /* TODO: add real InputName */
 
350
                                              PARSE_HOSTNAME, eFLOWCTL_LIGHT_DELAY, pThis->pSrv->pszInputName, NULL, 0);
347
351
                                pThis->iMsg = 0;
348
352
                                pThis->inputState = eAtStrtFram;
349
353
                        }