---- Pound-2.4.3-logfile/config.c 2008-12-11 00:22:22.509353295 +0200
-+++ Pound-2.4.3.logs/config.c 2009-01-08 17:47:08.523739629 +0200
-@@ -72,7 +72,7 @@
+diff -urNp -x '*.orig' Pound-2.8.org/config.c Pound-2.8/config.c
+--- Pound-2.8.org/config.c 2021-10-04 21:55:51.849501382 +0200
++++ Pound-2.8/config.c 2021-10-04 21:55:51.876168039 +0200
+@@ -73,7 +73,7 @@ static CODE facilitynames[] = {
};
#endif
static regex_t ListenHTTP, ListenHTTPS, End, Address, Port, Cert, xHTTP, Client, CheckURL;
static regex_t Err414, Err500, Err501, Err503, MaxRequest, HeadRemove, RewriteLocation, RewriteDestination;
static regex_t Service, ServiceName, URL, HeadRequire, HeadDeny, BackEnd, Emergency, Priority, HAport, HAportAddr;
-@@ -1104,6 +1104,18 @@
+@@ -1330,6 +1330,18 @@ parse_file(void)
def_facility = facilitynames[i].c_val;
break;
}
} else if(!regexec(&Grace, lin, 4, matches, 0)) {
grace = atoi(lin + matches[1].rm_so);
} else if(!regexec(&LogLevel, lin, 4, matches, 0)) {
-@@ -1204,7 +1216,9 @@
- || regcomp(&RootJail, "^[ \t]*RootJail[ \t]+\"(.+)\"[ \t]*$", REG_ICASE | REG_NEWLINE | REG_EXTENDED)
+@@ -1436,7 +1448,9 @@ config_parse(const int argc, char **cons
|| regcomp(&Daemon, "^[ \t]*Daemon[ \t]+([01])[ \t]*$", REG_ICASE | REG_NEWLINE | REG_EXTENDED)
+ || regcomp(&Threads, "^[ \t]*Threads[ \t]+([1-9][0-9]*)[ \t]*$", REG_ICASE | REG_NEWLINE | REG_EXTENDED)
|| regcomp(&LogFacility, "^[ \t]*LogFacility[ \t]+([a-z0-9-]+)[ \t]*$", REG_ICASE | REG_NEWLINE | REG_EXTENDED)
+ || regcomp(&LogFile, "^[ \t]*LogFile[ \t]+(.+)[ \t]*$", REG_ICASE | REG_NEWLINE | REG_EXTENDED)
|| regcomp(&LogLevel, "^[ \t]*LogLevel[ \t]+([0-5])[ \t]*$", REG_ICASE | REG_NEWLINE | REG_EXTENDED)
|| regcomp(&Grace, "^[ \t]*Grace[ \t]+([0-9]+)[ \t]*$", REG_ICASE | REG_NEWLINE | REG_EXTENDED)
|| regcomp(&Alive, "^[ \t]*Alive[ \t]+([1-9][0-9]*)[ \t]*$", REG_ICASE | REG_NEWLINE | REG_EXTENDED)
|| regcomp(&SSLEngine, "^[ \t]*SSLEngine[ \t]+\"(.+)\"[ \t]*$", REG_ICASE | REG_NEWLINE | REG_EXTENDED)
-@@ -1329,6 +1343,8 @@
+@@ -1572,6 +1586,8 @@ config_parse(const int argc, char **cons
group = NULL;
root_jail = NULL;
ctrl_name = NULL;
+ log_file = NULL;
+ error_log = NULL;
+ numthreads = 128;
alive_to = 30;
- daemonize = 1;
-@@ -1358,7 +1374,9 @@
- regfree(&RootJail);
+@@ -1601,7 +1617,9 @@ config_parse(const int argc, char **cons
regfree(&Daemon);
+ regfree(&Threads);
regfree(&LogFacility);
+ regfree(&LogFile);
regfree(&LogLevel);
regfree(&Grace);
regfree(&Alive);
regfree(&SSLEngine);
---- Pound-2.4.3/pound.c 2009-01-08 19:02:26.160354939 +0200
-+++ Pound-2.4.3.logsz/pound.c 2009-01-09 15:43:41.595643815 +0200
-@@ -33,6 +33,8 @@
+diff -urNp -x '*.orig' Pound-2.8.org/pound.c Pound-2.8/pound.c
+--- Pound-2.8.org/pound.c 2018-05-11 12:16:05.000000000 +0200
++++ Pound-2.8/pound.c 2021-10-04 21:55:51.876168039 +0200
+@@ -32,6 +32,8 @@ char *user, /* user
*group, /* group to run as */
*root_jail, /* directory to chroot to */
*pid_name, /* file to record pid in */
*ctrl_name; /* control socket name */
int alive_to, /* check interval for resurrection */
-@@ -54,6 +56,7 @@
+@@ -54,6 +56,7 @@ regex_t HEADER, /* Allowed h
AUTHORIZATION; /* the Authorisation header */
static int shut_down = 0;
#ifndef SOL_TCP
/* for systems without the definition */
-@@ -105,6 +108,33 @@
- return (unsigned long)pthread_self();
+@@ -183,6 +186,33 @@ get_thr_qlen(void)
+ return res;
}
+static void
/*
* handle SIGTERM/SIGQUIT - exit
*/
-@@ -142,6 +172,21 @@
+@@ -220,6 +250,21 @@ h_shut(const int sig)
}
/*
* Pound: the reverse-proxy/load-balancer
*
* Arguments:
-@@ -175,6 +220,7 @@
+@@ -254,6 +299,7 @@ main(const int argc, char **argv)
signal(SIGINT, h_shut);
signal(SIGTERM, h_term);
signal(SIGQUIT, h_term);
signal(SIGPIPE, SIG_IGN);
srandom(getpid());
-@@ -289,11 +335,23 @@
+@@ -386,11 +432,23 @@ main(const int argc, char **argv)
/* daemonize - make ourselves a subprocess. */
switch (fork()) {
case 0:
+ if (log_facility != -1) {
+ close(2);
+ }
-+ }
+ }
+ if (log_file) {
+ stdout = freopen(log_file, "a", stdout);
+ setlinebuf(stdout);
+ if (log_facility != -1) {
+ close(1);
+ }
- }
++ }
+ close(0);
break;
case -1:
logmsg(LOG_ERR, "fork: %s - aborted", strerror(errno));
-@@ -351,7 +409,6 @@
+@@ -448,7 +506,6 @@ main(const int argc, char **argv)
logmsg(LOG_ERR, "MONITOR: worker exited (stopped?) %d, restarting...", status);
} else if (son == 0) {
#endif
/* thread stuff */
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-@@ -392,6 +449,11 @@
+@@ -499,6 +556,11 @@ main(const int argc, char **argv)
(void)unlink(ctrl_name);
exit(0);
}
for(lstn = listeners, i = 0; i < n_listeners; lstn = lstn->next, i++) {
polls[i].events = POLLIN | POLLPRI;
polls[i].revents = 0;
---- Pound-2.4.3-logfile/pound.h 2008-12-11 00:16:43.449299956 +0200
-+++ Pound-2.4.3.logs/pound.h 2009-01-08 17:47:38.940178535 +0200
-@@ -236,6 +236,8 @@
+diff -urNp -x '*.orig' Pound-2.8.org/pound.h Pound-2.8/pound.h
+--- Pound-2.8.org/pound.h 2018-05-11 12:16:05.000000000 +0200
++++ Pound-2.8/pound.h 2021-10-04 21:55:51.876168039 +0200
+@@ -264,6 +264,8 @@ extern char *user, /* user
*group, /* group to run as */
*root_jail, /* directory to chroot to */
*pid_name, /* file to record pid in */
+ *error_log, /* print error messages to this file, instead of syslog */
*ctrl_name; /* control socket name */
- extern int alive_to, /* check interval for resurrection */
---- Pound-2.4.3/svc.c 2009-01-14 15:16:55.002576968 +0200
-+++ Pound-2.4.3/svc.c 2009-01-14 15:20:43.342553651 +0200
-@@ -172,49 +172,47 @@
+ extern int numthreads, /* number of worker threads */
+diff -urNp -x '*.orig' Pound-2.8.org/svc.c Pound-2.8/svc.c
+--- Pound-2.8.org/svc.c 2021-10-04 21:55:51.849501382 +0200
++++ Pound-2.8/svc.c 2021-10-04 21:55:51.876168039 +0200
+@@ -220,49 +220,47 @@ t_clean(LHASH_OF(TABNODE) *const tab, vo
#ifdef HAVE_STDARG_H
void
logmsg(const int priority, const char *fmt, ...)