aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Kraai <kraai@debian.org>2001-08-14 17:32:23 +0000
committerMatt Kraai <kraai@debian.org>2001-08-14 17:32:23 +0000
commitb6ec78161ddb081315ef468bd245fcd9f6c5f8df (patch)
treefc771cbcf7ed280db9158485eb51869e90c32846
parent0a6859031493951de02cc00e18f0da2bd305fc05 (diff)
downloadbusybox-w32-b6ec78161ddb081315ef468bd245fcd9f6c5f8df.tar.gz
busybox-w32-b6ec78161ddb081315ef468bd245fcd9f6c5f8df.tar.bz2
busybox-w32-b6ec78161ddb081315ef468bd245fcd9f6c5f8df.zip
Log all messages from a single connection, not just the first. Patch from
matthias@corelatus.com, approved by Gennady Feldman <gena01@cachier.com>.
-rw-r--r--sysklogd/syslogd.c6
-rw-r--r--syslogd.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index 14219eb54..25bc68f20 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -394,16 +394,17 @@ static int serveConnection (int conn)
394{ 394{
395 RESERVE_BB_BUFFER(tmpbuf, BUFSIZE + 1); 395 RESERVE_BB_BUFFER(tmpbuf, BUFSIZE + 1);
396 int n_read; 396 int n_read;
397 char *p = tmpbuf;
397 398
398 n_read = read (conn, tmpbuf, BUFSIZE ); 399 n_read = read (conn, tmpbuf, BUFSIZE );
399 400
400 if (n_read > 0) { 401 while (p < tmpbuf + n_read) {
401 402
402 int pri = (LOG_USER | LOG_NOTICE); 403 int pri = (LOG_USER | LOG_NOTICE);
403 char line[ BUFSIZE + 1 ]; 404 char line[ BUFSIZE + 1 ];
404 unsigned char c; 405 unsigned char c;
405 406
406 char *p = tmpbuf, *q = line; 407 char *q = line;
407 408
408 tmpbuf[ n_read - 1 ] = '\0'; 409 tmpbuf[ n_read - 1 ] = '\0';
409 410
@@ -428,6 +429,7 @@ static int serveConnection (int conn)
428 p++; 429 p++;
429 } 430 }
430 *q = '\0'; 431 *q = '\0';
432 p++;
431 /* Now log it */ 433 /* Now log it */
432 logMessage (pri, line); 434 logMessage (pri, line);
433 } 435 }
diff --git a/syslogd.c b/syslogd.c
index 14219eb54..25bc68f20 100644
--- a/syslogd.c
+++ b/syslogd.c
@@ -394,16 +394,17 @@ static int serveConnection (int conn)
394{ 394{
395 RESERVE_BB_BUFFER(tmpbuf, BUFSIZE + 1); 395 RESERVE_BB_BUFFER(tmpbuf, BUFSIZE + 1);
396 int n_read; 396 int n_read;
397 char *p = tmpbuf;
397 398
398 n_read = read (conn, tmpbuf, BUFSIZE ); 399 n_read = read (conn, tmpbuf, BUFSIZE );
399 400
400 if (n_read > 0) { 401 while (p < tmpbuf + n_read) {
401 402
402 int pri = (LOG_USER | LOG_NOTICE); 403 int pri = (LOG_USER | LOG_NOTICE);
403 char line[ BUFSIZE + 1 ]; 404 char line[ BUFSIZE + 1 ];
404 unsigned char c; 405 unsigned char c;
405 406
406 char *p = tmpbuf, *q = line; 407 char *q = line;
407 408
408 tmpbuf[ n_read - 1 ] = '\0'; 409 tmpbuf[ n_read - 1 ] = '\0';
409 410
@@ -428,6 +429,7 @@ static int serveConnection (int conn)
428 p++; 429 p++;
429 } 430 }
430 *q = '\0'; 431 *q = '\0';
432 p++;
431 /* Now log it */ 433 /* Now log it */
432 logMessage (pri, line); 434 logMessage (pri, line);
433 } 435 }