[PATCH] cookiedomain -> cookie_domain rename + free(p->cookie_domain)

From: Krzysztof Oledzki <ole#ans.pl>
Date: Fri, 30 May 2008 00:00:00 +0200


From d9fca94e02ac071e36413ddf0e024f9d7a33ea19 Mon Sep 17 00:00:00 2001 From: Krzysztof Piotr Oledzki <ole#ans.pl> Date: Thu, 29 May 2008 23:03:34 +0200
Subject: [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()

---
 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 81e182d..9129861 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 9ca8ae6..e4308bf 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c @@ -917,7 +917,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 fc82d2f..b42728e 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c @@ -658,6 +658,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 3caeba1..066db30 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c @@ -3222,8 +3222,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) -- 1.5.5.1
Received on 2008/05/30 00:00

This archive was generated by hypermail 2.2.0 : 2008/05/30 00:15 CEST