[syslog-ng] TCP problems patch
Balazs Scheidler
bazsi@balabit.hu
Wed, 29 Dec 1999 22:59:24 +0100
Hi,
I tried to fix the TCP related bugs reported by many people.
There are two patches, one against libol0.2.10, and one against
syslog-ng1.3.10, please test if these fix the encountered problems, or not.
diff -urN libol-0.2.10/src/io.c libol-0.2.11/src/io.c
--- libol-0.2.10/src/io.c Thu Dec 16 18:15:39 1999
+++ libol-0.2.11/src/io.c Mon Dec 27 23:53:38 1999
@@ -232,16 +232,16 @@
WRITE_FD(fd);
else {
verbose("io_iter(): POLLHUP on inactive fd!\n");
- closekill_fd(fd, CLOSE_EOF);
+ close_fd(fd, CLOSE_EOF);
}
continue;
}
if (fds[i].revents & POLLPRI) {
- closekill_fd(fd, CLOSE_PROTOCOL_FAILURE);
+ close_fd(fd, CLOSE_PROTOCOL_FAILURE);
continue;
}
if (fds[i].revents & (POLLNVAL | POLLERR))
- closekill_fd(fd, CLOSE_POLL_FAILED);
+ close_fd(fd, CLOSE_POLL_FAILED);
if (fds[i].revents & POLLOUT)
if (fd->want_write && fd->write)
WRITE_FD(fd);
@@ -270,7 +270,7 @@
}
}
if (!nfds && !nco) {
- verbose("io_iter(): no waiting fds and no callouts! exiting...\n");
+ werror("No listening fds and no pending events, exiting...\n");
return 0;
}
return 1;
@@ -486,7 +486,7 @@
res = BUF_FLUSH(self->buffer, &w.super);
if (ST_CLOSEDP(res))
{
- closekill_fd(fd, ST_FAILUREP(res) ? CLOSE_PROTOCOL_FAILURE : CLOSE_EOF);
+ close_fd(fd, ST_FAILUREP(res) ? CLOSE_PROTOCOL_FAILURE : CLOSE_EOF);
}
}
diff -urN libol-0.2.10/src/pkt_buffer.c libol-0.2.11/src/pkt_buffer.c
--- libol-0.2.10/src/pkt_buffer.c Thu Dec 16 18:12:21 1999
+++ libol-0.2.11/src/pkt_buffer.c Mon Dec 27 23:49:20 1999
@@ -109,8 +109,8 @@
}
}
else {
- werror("pkt_buffer::do_flush(): Error flushing data\n");
- return ST_FAIL | ST_CLOSE;
+ verbose("pkt_buffer::do_flush(): Error flushing data\n");
+ return ST_CLOSE;
}
}
return ST_OK | ST_GOON;
this against syslog-ng:
diff -urN syslog-ng-1.3.10/src/log.c syslog-ng-1.3.11/src/log.c
--- syslog-ng-1.3.10/src/log.c Mon Nov 22 19:26:16 1999
+++ syslog-ng-1.3.11/src/log.c Mon Dec 27 23:45:02 1999
@@ -116,9 +116,15 @@
src = oldsrc;
left = oldleft;
}
+
+ while (left && *src == ' ') {
+ src++; /* skip whitespace */
+ left--;
+ }
oldsrc = src;
oldleft = left;
+
while (left && *src != ':' && *src != '[') {
src++;
left--;
--
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1
url: http://www.balabit.hu/pgpkey.txt