[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()
This commit is contained in:
Krzysztof Piotr Oledzki 2008-05-29 23:03:34 +02:00 committed by Willy Tarreau
parent 8a7af60312
commit 1acf217366
4 changed files with 7 additions and 4 deletions

View File

@ -161,7 +161,7 @@ struct proxy {
void (*server_drop_conn)(struct server *);/* to be called when connection is dropped */ void (*server_drop_conn)(struct server *);/* to be called when connection is dropped */
} lbprm; /* LB parameters for all algorithms */ } 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 */ char *cookie_name; /* name of the cookie to look for */
int cookie_len; /* strlen(cookie_name), computed only once */ int cookie_len; /* strlen(cookie_name), computed only once */
char *url_param_name; /* name of the URL parameter used for hashing */ char *url_param_name; /* name of the URL parameter used for hashing */

View File

@ -917,7 +917,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int inv)
return -1; return -1;
} }
curproxy->cookiedomain = strdup(args[cur_arg + 1]); curproxy->cookie_domain = strdup(args[cur_arg + 1]);
cur_arg++; cur_arg++;
} }
else { else {

View File

@ -658,6 +658,9 @@ void deinit(void)
if (p->cookie_name) if (p->cookie_name)
free(p->cookie_name); free(p->cookie_name);
if (p->cookie_domain)
free(p->cookie_domain);
if (p->url_param_name) if (p->url_param_name)
free(p->url_param_name); free(p->url_param_name);

View File

@ -3222,8 +3222,8 @@ int process_srv(struct session *t)
t->be->cookie_name, t->be->cookie_name,
t->srv->cookie ? t->srv->cookie : "; Expires=Thu, 01-Jan-1970 00:00:01 GMT"); t->srv->cookie ? t->srv->cookie : "; Expires=Thu, 01-Jan-1970 00:00:01 GMT");
if (t->be->cookiedomain) if (t->be->cookie_domain)
len += sprintf(trash+len, "; domain=%s", t->be->cookiedomain); len += sprintf(trash+len, "; domain=%s", t->be->cookie_domain);
if (unlikely(http_header_add_tail2(rep, &txn->rsp, &txn->hdr_idx, if (unlikely(http_header_add_tail2(rep, &txn->rsp, &txn->hdr_idx,
trash, len)) < 0) trash, len)) < 0)