]> git.kaiwu.me - 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>
Thu, 3 Dec 2009 22:53:58 +0000 (23:53 +0100)
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
src/cfgparse.c
src/haproxy.c
src/proto_http.c

index 6c366b8e869f6ade9b23a1bebd516691500496c9..41a94164532cf25cb7e17cee01f90a7d2ab63ad4 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 99ffc0abbaaf6a83e517c8ecde042cd1cebccecd..801cf820d3073fe69a9c4511b6ff50ca4f441fde 100644 (file)
@@ -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 {
index 7992c1cbfcb79730436c1db4a95566b21ed4fa2a..9eee847d37f8ac2e3452c3998b110a3f7aee6baa 100644 (file)
@@ -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);
 
index 95505b67aab6e2076e83c11c26276b070ded4203..ee682b57e7604f47a59ea9cde56dd79ab9929d52 100644 (file)
@@ -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)