From: Bob P. <rn...@op...> - 2002-11-14 21:23:09
|
At 02:06 AM 11/14/02 -0500, I wrote: >I'm testing a possible solution tonight. Will forward the results tomorrow. > >Bob > >At 01:08 PM 11/13/02 -0500, I wrote: >>SourceForge Bug 637894 has been opened for this problem. >><etc> The following patches are for msyslogd 1.08e ONLY!!! This problem has been addressed already in 1.09. I have closed my SourceForge Bug report 637894. These patches to src/modules/im_tcp.c fix this problem, as well as one reported earlier, in 1.08e ONLY. Bob ======================================================================== --- src/modules/im_tcp.c.orig Fri Mar 1 02:31:02 2002 +++ src/modules/im_tcp.c Thu Nov 14 14:34:15 2002 @@ -269,13 +269,13 @@ if (con == c->first) { c->first = con->next; - if (con == c->last) - c->last = NULL; } else { for(prev = c->first; prev->next != con; prev = prev->next); prev->next = con->next; } + if (con == c->last) + c->last = NULL; if (con->saveline[0] != '\0') printline(ret->im_host, con->saveline, @@ -297,7 +297,6 @@ /* terminate it */ (im->im_buf)[n] = '\0'; - p = &im->im_buf[0]; dprintf(MSYSLOG_INFORMATIVE, "im_tcp_read: read: %s [%s]", con->name, im->im_buf); @@ -311,8 +310,6 @@ do { char *msg; - msg = p; - /* multiple lines ? */ if((nextline = strchr(p, '\n')) != NULL) { /* terminate this line and advance */ @@ -324,6 +321,7 @@ strncat(con->saveline, p, sizeof(con->saveline) - 1); con->saveline[sizeof(con->saveline) - 1] = '\0'; + return (0); } /* remove trailing carriage returns */ @@ -338,20 +336,20 @@ return (0); } + if (con->saveline[0] != '\0') { + strncat(con->saveline, p, + sizeof(con->saveline) - 1); + con->saveline[sizeof(con->saveline) - 1] + = '\0'; + msg = con->saveline; + } else { + msg = p; + } + if (c->flags & M_USEMSGHOST) { char host[90]; int n1, n2; - if (con->saveline[0] != '\0') { - strncat(con->saveline, p, - sizeof(con->saveline) - 1); - con->saveline[sizeof(con->saveline) - 1] - = '\0'; - msg = con->saveline; - } else { - msg = p; - } - /* extract hostname from message */ if ((sscanf(msg, "<%*d>%*3s %*i %*i:%*i:%*i %n%89s" " %n", &n1, host, &n2) != 1 && @@ -367,8 +365,8 @@ p = nextline; continue; } else { - return (0); con->saveline[0] = '\0'; + return (0); } } ======================================================================== |