From 4412f9815adfbd03fdec282be047ba6188762487 Mon Sep 17 00:00:00 2001 From: Krzysztof Piotr Oledzki Date: Thu, 29 May 2008 23:03:34 +0200 Subject: [PATCH] [BUG/CLEANUP] cookiedomain -> cookie_domain rename + free(p->cookie_domain) Rename cookiedomain -> cookie_domain to be consistent with current naming scheme. Also make sure cookie_domain is deallocated at deinit() (cherry picked from commit 1acf2173669e2b82060412b2100943054ed620d5) --- include/types/proxy.h | 2 +- src/cfgparse.c | 2 +- src/haproxy.c | 3 +++ src/proto_http.c | 4 ++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/types/proxy.h b/include/types/proxy.h index 6c366b8e8..41a941645 100644 --- a/include/types/proxy.h +++ b/include/types/proxy.h @@ -161,7 +161,7 @@ struct proxy { void (*server_drop_conn)(struct server *);/* to be called when connection is dropped */ } lbprm; /* LB parameters for all algorithms */ - char *cookiedomain; /* domain used to insert the cookie */ + char *cookie_domain; /* domain used to insert the cookie */ char *cookie_name; /* name of the cookie to look for */ int cookie_len; /* strlen(cookie_name), computed only once */ char *url_param_name; /* name of the URL parameter used for hashing */ diff --git a/src/cfgparse.c b/src/cfgparse.c index 99ffc0abb..801cf820d 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -929,7 +929,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int inv) return -1; } - curproxy->cookiedomain = strdup(args[cur_arg + 1]); + curproxy->cookie_domain = strdup(args[cur_arg + 1]); cur_arg++; } else { diff --git a/src/haproxy.c b/src/haproxy.c index 7992c1cbf..9eee847d3 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -651,6 +651,9 @@ void deinit(void) if (p->cookie_name) free(p->cookie_name); + if (p->cookie_domain) + free(p->cookie_domain); + if (p->url_param_name) free(p->url_param_name); diff --git a/src/proto_http.c b/src/proto_http.c index 95505b67a..ee682b57e 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -3220,8 +3220,8 @@ int process_srv(struct session *t) t->be->cookie_name, t->srv->cookie ? t->srv->cookie : "; Expires=Thu, 01-Jan-1970 00:00:01 GMT"); - if (t->be->cookiedomain) - len += sprintf(trash+len, "; domain=%s", t->be->cookiedomain); + if (t->be->cookie_domain) + len += sprintf(trash+len, "; domain=%s", t->be->cookie_domain); if (unlikely(http_header_add_tail2(rep, &txn->rsp, &txn->hdr_idx, trash, len)) < 0) -- 2.47.3