]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUG/CLEANUP] cookiedomain -> cookie_domain rename + free(p->cookie_domain)
authorKrzysztof Piotr Oledzki <ole@ans.pl>
Thu, 29 May 2008 21:03:34 +0000 (23:03 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 30 May 2008 05:03:22 +0000 (07:03 +0200)
Rename cookiedomain -> cookie_domain to be consistent with current
naming scheme. Also make sure cookie_domain is deallocated at deinit()

include/types/proxy.h
src/cfgparse.c
src/haproxy.c
src/proto_http.c

index 81e182dd0b31a4334e75ebb49854bce13a6b9eb2..9129861c36fbfad0d79b714d29bf51a1db7a0138 100644 (file)
@@ -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 */
index 9ca8ae64f46a3235645984e5b36ad2f11b4ae681..e4308bf6dd26f255ea45499fb4687c94e6679c94 100644 (file)
@@ -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 {
index fc82d2f8fe2f1823f0c9e0a9e30d9f2f7d871379..b42728eccbf3eeb59204e19c0177dcbbb49da57e 100644 (file)
@@ -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);
 
index 3caeba1cff0e271d84b0bc55009c68bf4c49f73a..066db30dcacecdfb27150fa6c563040e66c75654 100644 (file)
@@ -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)