mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 06:11:32 +02:00
MINOR: backend: make the header hash use arg_opt1 for use_domain_only
This is only a boolean extra arg. Let's map it to arg_opt1 and remove hh_match_domain from struct proxy.
This commit is contained in:
parent
20e68378f1
commit
9fed8586b5
@ -323,7 +323,6 @@ struct proxy {
|
|||||||
int uri_len_limit; /* character limit for uri balancing algorithm */
|
int uri_len_limit; /* character limit for uri balancing algorithm */
|
||||||
int uri_dirs_depth1; /* directories+1 (slashes) limit for uri balancing algorithm */
|
int uri_dirs_depth1; /* directories+1 (slashes) limit for uri balancing algorithm */
|
||||||
int uri_whole; /* if != 0, calculates the hash from the whole uri. Still honors the len_limit and dirs_depth1 */
|
int uri_whole; /* if != 0, calculates the hash from the whole uri. Still honors the len_limit and dirs_depth1 */
|
||||||
int hh_match_domain; /* toggle use of special match function */
|
|
||||||
char *capture_name; /* beginning of the name of the cookie to capture */
|
char *capture_name; /* beginning of the name of the cookie to capture */
|
||||||
int capture_namelen; /* length of the cookie name to match */
|
int capture_namelen; /* length of the cookie name to match */
|
||||||
int capture_len; /* length of the string to be captured */
|
int capture_len; /* length of the string to be captured */
|
||||||
|
@ -394,7 +394,8 @@ static struct server *get_server_ph_post(struct stream *s, const struct server *
|
|||||||
* performance by avoiding bounces between servers in contexts where sessions
|
* performance by avoiding bounces between servers in contexts where sessions
|
||||||
* are shared but cookies are not usable. If the parameter is not found, NULL
|
* are shared but cookies are not usable. If the parameter is not found, NULL
|
||||||
* is returned. If any server is found, it will be returned. If no valid server
|
* is returned. If any server is found, it will be returned. If no valid server
|
||||||
* is found, NULL is returned.
|
* is found, NULL is returned. When lbprm.arg_opt1 is set, the hash will only
|
||||||
|
* apply to the middle part of a domain name ("use_domain_only" option).
|
||||||
*/
|
*/
|
||||||
static struct server *get_server_hh(struct stream *s, const struct server *avoid)
|
static struct server *get_server_hh(struct stream *s, const struct server *avoid)
|
||||||
{
|
{
|
||||||
@ -429,7 +430,7 @@ static struct server *get_server_hh(struct stream *s, const struct server *avoid
|
|||||||
*/
|
*/
|
||||||
len = ctx.vlen;
|
len = ctx.vlen;
|
||||||
p = (char *)ctx.line + ctx.val;
|
p = (char *)ctx.line + ctx.val;
|
||||||
if (!px->hh_match_domain) {
|
if (!px->lbprm.arg_opt1) {
|
||||||
hash = gen_hash(px, p, len);
|
hash = gen_hash(px, p, len);
|
||||||
} else {
|
} else {
|
||||||
int dohash = 0;
|
int dohash = 0;
|
||||||
@ -1802,14 +1803,14 @@ int backend_parse_balance(const char **args, char **err, struct proxy *curproxy)
|
|||||||
free(curproxy->lbprm.arg_str);
|
free(curproxy->lbprm.arg_str);
|
||||||
curproxy->lbprm.arg_len = end - beg;
|
curproxy->lbprm.arg_len = end - beg;
|
||||||
curproxy->lbprm.arg_str = my_strndup(beg, end - beg);
|
curproxy->lbprm.arg_str = my_strndup(beg, end - beg);
|
||||||
curproxy->hh_match_domain = 0;
|
curproxy->lbprm.arg_opt1 = 0;
|
||||||
|
|
||||||
if (*args[1]) {
|
if (*args[1]) {
|
||||||
if (strcmp(args[1], "use_domain_only")) {
|
if (strcmp(args[1], "use_domain_only")) {
|
||||||
memprintf(err, "%s only accepts 'use_domain_only' modifier (got '%s').", args[0], args[1]);
|
memprintf(err, "%s only accepts 'use_domain_only' modifier (got '%s').", args[0], args[1]);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
curproxy->hh_match_domain = 1;
|
curproxy->lbprm.arg_opt1 = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!strncmp(args[0], "rdp-cookie", 10)) {
|
else if (!strncmp(args[0], "rdp-cookie", 10)) {
|
||||||
|
@ -479,8 +479,6 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
|
|||||||
curproxy->uri_len_limit = defproxy.uri_len_limit;
|
curproxy->uri_len_limit = defproxy.uri_len_limit;
|
||||||
curproxy->uri_dirs_depth1 = defproxy.uri_dirs_depth1;
|
curproxy->uri_dirs_depth1 = defproxy.uri_dirs_depth1;
|
||||||
|
|
||||||
curproxy->hh_match_domain = defproxy.hh_match_domain;
|
|
||||||
|
|
||||||
if (defproxy.conn_src.iface_name)
|
if (defproxy.conn_src.iface_name)
|
||||||
curproxy->conn_src.iface_name = strdup(defproxy.conn_src.iface_name);
|
curproxy->conn_src.iface_name = strdup(defproxy.conn_src.iface_name);
|
||||||
curproxy->conn_src.iface_len = defproxy.conn_src.iface_len;
|
curproxy->conn_src.iface_len = defproxy.conn_src.iface_len;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user