int tot_used; /* total number of servers used for LB */
int wmult; /* ratio between user weight and effective weight */
int wdiv; /* ratio between effective weight and user weight */
+ char *arg_str; /* name of the URL parameter used for hashing */
+ int arg_len; /* strlen(arg_str), computed only once */
struct server *fbck; /* first backup server when !PR_O_USE_ALL_BK, or NULL */
struct lb_map map; /* LB parameters for map-based algorithms */
struct lb_fwrr fwrr;
unsigned int cookie_maxlife; /* max life time for this cookie */
char *rdp_cookie_name; /* name of the RDP cookie to look for */
int rdp_cookie_len; /* strlen(rdp_cookie_name), computed only once */
- char *url_param_name; /* name of the URL parameter used for hashing */
- int url_param_len; /* strlen(url_param_name), computed only once */
int uri_len_limit; /* character 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 */
p++;
uri_len -= (p - uri);
- plen = px->url_param_len;
+ plen = px->lbprm.arg_len;
params = p;
while (uri_len > plen) {
/* Look for the parameter name followed by an equal symbol */
if (params[plen] == '=') {
- if (memcmp(params, px->url_param_name, plen) == 0) {
+ if (memcmp(params, px->lbprm.arg_str, plen) == 0) {
/* OK, we have the parameter here at <params>, and
* the value after the equal sign, at <p>
* skip the equal symbol
struct channel *req = &s->req;
struct http_msg *msg = &txn->req;
struct proxy *px = s->be;
- unsigned int plen = px->url_param_len;
+ unsigned int plen = px->lbprm.arg_len;
unsigned long len = http_body_bytes(msg);
const char *params = c_ptr(req, -http_data_rewind(msg));
const char *p = params;
while (len > plen) {
/* Look for the parameter name followed by an equal symbol */
if (params[plen] == '=') {
- if (memcmp(params, px->url_param_name, plen) == 0) {
+ if (memcmp(params, px->lbprm.arg_str, plen) == 0) {
/* OK, we have the parameter here at <params>, and
* the value after the equal sign, at <p>
* skip the equal symbol
curproxy->lbprm.algo &= ~BE_LB_ALGO;
curproxy->lbprm.algo |= BE_LB_ALGO_PH;
- free(curproxy->url_param_name);
- curproxy->url_param_name = strdup(args[1]);
- curproxy->url_param_len = strlen(args[1]);
+ free(curproxy->lbprm.arg_str);
+ curproxy->lbprm.arg_str = strdup(args[1]);
+ curproxy->lbprm.arg_len = strlen(args[1]);
if (*args[2]) {
if (strcmp(args[2], "check_post")) {
memprintf(err, "%s only accepts 'check_post' modifier (got '%s').", args[0], args[2]);
curproxy->rdp_cookie_name = strdup(defproxy.rdp_cookie_name);
curproxy->rdp_cookie_len = defproxy.rdp_cookie_len;
- if (defproxy.url_param_name)
- curproxy->url_param_name = strdup(defproxy.url_param_name);
- curproxy->url_param_len = defproxy.url_param_len;
+ if (defproxy.lbprm.arg_str)
+ curproxy->lbprm.arg_str = strdup(defproxy.lbprm.arg_str);
+ curproxy->lbprm.arg_len = defproxy.lbprm.arg_len;
curproxy->uri_whole = defproxy.uri_whole;
curproxy->uri_len_limit = defproxy.uri_len_limit;
curproxy->uri_dirs_depth1 = defproxy.uri_dirs_depth1;
free(defproxy.rdp_cookie_name);
free(defproxy.dyncookie_key);
free(defproxy.cookie_domain);
- free(defproxy.url_param_name);
+ free(defproxy.lbprm.arg_str);
free(defproxy.hh_name);
free(defproxy.capture_name);
free(defproxy.monitor_uri);