MINOR: backend: move url_param_name/len to lbprm.arg_str/len
This one is exclusively used by LB parameters, when using URL param
hashing. Let's move it to the lbprm struct under a more generic name.
diff --git a/src/backend.c b/src/backend.c
index 13543c9..9b6f316 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -271,13 +271,13 @@
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
@@ -322,7 +322,7 @@
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;
@@ -340,7 +340,7 @@
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
@@ -1775,9 +1775,9 @@
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]);
diff --git a/src/cfgparse-listen.c b/src/cfgparse-listen.c
index 8d2c176..b737ffa 100644
--- a/src/cfgparse-listen.c
+++ b/src/cfgparse-listen.c
@@ -467,9 +467,9 @@
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;
@@ -621,7 +621,7 @@
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);
diff --git a/src/haproxy.c b/src/haproxy.c
index d47dff3..dbc2ada 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -2246,7 +2246,7 @@
free(p->check_req);
free(p->cookie_name);
free(p->cookie_domain);
- free(p->url_param_name);
+ free(p->lbprm.arg_str);
free(p->capture_name);
free(p->monitor_uri);
free(p->rdp_cookie_name);