francisco.ruiz(at)juntaextremadura.es
Ahorrar papel protege el medio ambiente
---- config.c.orig 2010-02-02 12:49:02.000000000 +0100
-+++ config.c 2011-11-14 21:52:49.000000000 +0100
+--- Pound-2.5/config.c 2011-12-09 21:06:52.351470209 +0200
++++ Pound-2.5/config.c 2011-12-09 21:06:52.351470209 +0200
@@ -625,6 +625,7 @@
parse_HTTP(void)
{
LISTENER *res;
SERVICE *svc;
MATCHER *m;
-@@ -719,8 +720,18 @@
+@@ -719,8 +720,19 @@
conf_err("HeadRemove bad pattern - aborted");
} else if(!regexec(&AddHeader, lin, 4, matches, 0)) {
lin[matches[1].rm_eo] = '\0';
+ conf_err("AddHeader config: out of memory - aborted");
+ sprintf(ah, "%s\r\n%s", res->add_head, lin + matches[1].rm_so);
+ }
-+ free(res->add_head);
++ if (res->add_head)
++ free(res->add_head);
+ res->add_head = ah;
} else if(!regexec(&RewriteLocation, lin, 4, matches, 0)) {
res->rewr_loc = atoi(lin + matches[1].rm_so);
} else if(!regexec(&RewriteDestination, lin, 4, matches, 0)) {
-@@ -772,6 +783,7 @@
+@@ -772,6 +785,7 @@
parse_HTTPS(void)
{
char lin[MAXBUF];
LISTENER *res;
SERVICE *svc;
MATCHER *m;
-@@ -902,8 +914,18 @@
+@@ -902,8 +916,19 @@
}
} else if(!regexec(&AddHeader, lin, 4, matches, 0)) {
lin[matches[1].rm_eo] = '\0';
+ conf_err("AddHeader config: out of memory - aborted");
+ sprintf(ah, "%s\r\n%s", res->add_head, lin + matches[1].rm_so);
+ }
-+ free(res->add_head);
++ if (res->add_head)
++ free(res->add_head);
+ res->add_head = ah;
} else if(!regexec(&Ciphers, lin, 4, matches, 0)) {
lin[matches[1].rm_eo] = '\0';
SSL_CTX_set_cipher_list(res->ctx, lin + matches[1].rm_so);
---- pound.h.orig 2010-02-02 12:49:02.000000000 +0100
-+++ pound.h 2011-11-15 21:40:40.000000000 +0100
+--- ./pound.h.orig 2010-02-02 12:49:02.000000000 +0100
++++ ./pound.h 2011-11-15 21:40:40.000000000 +0100
@@ -354,7 +354,7 @@
SSL_CTX *ctx; /* CTX for SSL connections */
int clnt_check; /* client verification mode */
regex_t verb; /* pattern to match the request verb against */
int to; /* client time-out */
int has_pat; /* was a URL pattern defined? */
---- pound.8.orig 2010-02-02 12:49:02.000000000 +0100
-+++ pound.8 2011-11-15 21:48:02.000000000 +0100
+--- ./pound.8.orig 2010-02-02 12:49:02.000000000 +0100
++++ ./pound.8 2011-11-15 21:48:02.000000000 +0100
@@ -405,7 +405,7 @@
.TP
\fBAddHeader\fR "header: to add"