Index: syslog-ng-1.5.20/src/afinet.c diff -c syslog-ng-1.5.20/src/afinet.c:1.1 syslog-ng-1.5.20/src/afinet.c:1.2 *** syslog-ng-1.5.20/src/afinet.c:1.1 Fri Sep 27 11:33:56 2002 --- syslog-ng-1.5.20/src/afinet.c Fri Sep 27 11:36:17 2002 *************** *** 19,25 **** * * Inspired by nsyslog, originally written by Darren Reed. * ! * $Id: afinet.c,v 1.1 2002/09/27 09:33:56 mt Exp $ * ***************************************************************************/ --- 19,25 ---- * * Inspired by nsyslog, originally written by Darren Reed. * ! * $Id: afinet.c,v 1.2 2002/09/27 09:36:17 mt Exp $ * ***************************************************************************/ *************** *** 89,101 **** notice("AF_INET client connected from %S, port %i\n", inet->ip, inet->port); io_read(self->client, ! make_log_reader(0, NULL, cfg->log_msg_size, 0, cfg->check_hostname ? LF_CHECK_HOSTNAME : 0, c), make_afsocket_source_close_callback(self)); } else { /* SOCK_DGRAM */ io_read(self->client, ! make_log_reader(1, NULL, cfg->log_msg_size, 0, cfg->check_hostname ? LF_CHECK_HOSTNAME : 0, c), make_afsocket_source_close_callback(self)); } --- 89,105 ---- notice("AF_INET client connected from %S, port %i\n", inet->ip, inet->port); io_read(self->client, ! make_log_reader(0, NULL, cfg->log_msg_size, 0, ! ( cfg->check_hostname ? LF_CHECK_HOSTNAME : 0 ) | ! ( cfg->use_time_recvd ? LF_USE_TIME_RECVD : 0 ) , c), make_afsocket_source_close_callback(self)); } else { /* SOCK_DGRAM */ io_read(self->client, ! make_log_reader(1, NULL, cfg->log_msg_size, 0, ! ( cfg->check_hostname ? LF_CHECK_HOSTNAME : 0 ) | ! ( cfg->use_time_recvd ? LF_USE_TIME_RECVD : 0 ) , c), make_afsocket_source_close_callback(self)); } Index: syslog-ng-1.5.20/src/log.c diff -c syslog-ng-1.5.20/src/log.c:1.1 syslog-ng-1.5.20/src/log.c:1.2 *** syslog-ng-1.5.20/src/log.c:1.1 Fri Sep 27 11:33:57 2002 --- syslog-ng-1.5.20/src/log.c Fri Sep 27 11:36:17 2002 *************** *** 19,25 **** * * Inspired by nsyslog, originally written by Darren Reed. * ! * $Id: log.c,v 1.1 2002/09/27 09:33:57 mt Exp $ * ***************************************************************************/ --- 19,25 ---- * * Inspired by nsyslog, originally written by Darren Reed. * ! * $Id: log.c,v 1.2 2002/09/27 09:36:17 mt Exp $ * ***************************************************************************/ *************** *** 47,53 **** int left; int pri; time_t now = time(NULL); ! char *oldsrc; int oldleft; src = data; --- 47,53 ---- int left; int pri; time_t now = time(NULL); ! char *oldsrc, ts[20]; int oldleft; src = data; *************** *** 94,102 **** src[9] == ':' && src[12] == ':') { struct tm tm, *nowtm; ! /* Just read the buffer data into a textual ! datestamp. */ ! lm->date = c_format_cstring("%s", 15, src); src += 15; left -= 15; --- 94,112 ---- src[9] == ':' && src[12] == ':') { struct tm tm, *nowtm; ! if (lm->flags & LF_USE_TIME_RECVD) { ! if (!(nowtm = localtime(now))) { ! lm->date = c_format("%i", lm->recvd); ! } else { ! strftime(ts, sizeof(ts) - 1, "%h %e %H:%M:%S", nowtm); ! ts[16] = '\0'; ! lm->date = c_format("%z", ts); ! } ! } else { ! /* Just read the buffer data into a textual ! datestamp. */ ! lm->date = c_format_cstring("%s", 15, src); ! } src += 15; left -= 15; Index: syslog-ng-1.5.20/src/log.h diff -c syslog-ng-1.5.20/src/log.h:1.1 syslog-ng-1.5.20/src/log.h:1.2 *** syslog-ng-1.5.20/src/log.h:1.1 Fri Sep 27 11:33:57 2002 --- syslog-ng-1.5.20/src/log.h Fri Sep 27 11:36:17 2002 *************** *** 19,25 **** * * Inspired by nsyslog, originally written by Darren Reed. * ! * $Id: log.h,v 1.1 2002/09/27 09:33:57 mt Exp $ * ***************************************************************************/ --- 19,25 ---- * * Inspired by nsyslog, originally written by Darren Reed. * ! * $Id: log.h,v 1.2 2002/09/27 09:36:17 mt Exp $ * ***************************************************************************/ *************** *** 57,62 **** --- 57,63 ---- #define LF_MARK 0x0002 #define LF_LOCAL 0x0004 #define LF_CHECK_HOSTNAME 0x0100 + #define LF_USE_TIME_RECVD 0x0200 #define LF_USER_FLAGS 0xff00