CLEANUP: config: remove appsession initialization
Now it asks to check the documentation.
This commit is contained in:
parent
53a09d520e
commit
6db62c58d6
@ -3430,76 +3430,10 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!strcmp(args[0], "appsession")) { /* cookie name */
|
else if (!strcmp(args[0], "appsession")) { /* cookie name */
|
||||||
int cur_arg;
|
Alert("parsing [%s:%d] : '%s' is not supported anymore, please check the documentation.\n", file, linenum, args[0]);
|
||||||
|
err_code |= ERR_ALERT | ERR_FATAL;
|
||||||
if (curproxy == &defproxy) {
|
goto out;
|
||||||
Alert("parsing [%s:%d] : '%s' not allowed in 'defaults' section.\n", file, linenum, args[0]);
|
}
|
||||||
err_code |= ERR_ALERT | ERR_FATAL;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (warnifnotcap(curproxy, PR_CAP_BE, file, linenum, args[0], NULL))
|
|
||||||
err_code |= ERR_WARN;
|
|
||||||
|
|
||||||
if (*(args[5]) == 0) {
|
|
||||||
Alert("parsing [%s:%d] : '%s' expects 'appsession' <cookie_name> 'len' <len> 'timeout' <timeout> [options*].\n",
|
|
||||||
file, linenum, args[0]);
|
|
||||||
err_code |= ERR_ALERT | ERR_FATAL;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
have_appsession = 1;
|
|
||||||
free(curproxy->appsession_name);
|
|
||||||
curproxy->appsession_name = strdup(args[1]);
|
|
||||||
curproxy->appsession_name_len = strlen(curproxy->appsession_name);
|
|
||||||
curproxy->appsession_len = atoi(args[3]);
|
|
||||||
err = parse_time_err(args[5], &val, TIME_UNIT_MS);
|
|
||||||
if (err) {
|
|
||||||
Alert("parsing [%s:%d] : unexpected character '%c' in %s timeout.\n",
|
|
||||||
file, linenum, *err, args[0]);
|
|
||||||
err_code |= ERR_ALERT | ERR_FATAL;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
curproxy->timeout.appsession = val;
|
|
||||||
|
|
||||||
if (appsession_hash_init(&(curproxy->htbl_proxy), destroy) == 0) {
|
|
||||||
Alert("parsing [%s:%d] : out of memory.\n", file, linenum);
|
|
||||||
err_code |= ERR_ALERT | ERR_ABORT;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
cur_arg = 6;
|
|
||||||
curproxy->options2 &= ~PR_O2_AS_REQL;
|
|
||||||
curproxy->options2 &= ~PR_O2_AS_M_ANY;
|
|
||||||
curproxy->options2 |= PR_O2_AS_M_PP;
|
|
||||||
while (*(args[cur_arg])) {
|
|
||||||
if (!strcmp(args[cur_arg], "request-learn")) {
|
|
||||||
curproxy->options2 |= PR_O2_AS_REQL;
|
|
||||||
} else if (!strcmp(args[cur_arg], "prefix")) {
|
|
||||||
curproxy->options2 |= PR_O2_AS_PFX;
|
|
||||||
} else if (!strcmp(args[cur_arg], "mode")) {
|
|
||||||
if (!*args[cur_arg + 1]) {
|
|
||||||
Alert("parsing [%s:%d] : '%s': missing argument for '%s'.\n",
|
|
||||||
file, linenum, args[0], args[cur_arg]);
|
|
||||||
err_code |= ERR_ALERT | ERR_FATAL;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
|
|
||||||
cur_arg++;
|
|
||||||
if (!strcmp(args[cur_arg], "query-string")) {
|
|
||||||
curproxy->options2 &= ~PR_O2_AS_M_ANY;
|
|
||||||
curproxy->options2 |= PR_O2_AS_M_QS;
|
|
||||||
} else if (!strcmp(args[cur_arg], "path-parameters")) {
|
|
||||||
curproxy->options2 &= ~PR_O2_AS_M_ANY;
|
|
||||||
curproxy->options2 |= PR_O2_AS_M_PP;
|
|
||||||
} else {
|
|
||||||
Alert("parsing [%s:%d] : unknown mode '%s'\n", file, linenum, args[cur_arg]);
|
|
||||||
err_code |= ERR_ALERT | ERR_FATAL;
|
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cur_arg++;
|
|
||||||
}
|
|
||||||
} /* Url App Session */
|
|
||||||
else if (!strcmp(args[0], "capture")) {
|
else if (!strcmp(args[0], "capture")) {
|
||||||
if (warnifnotcap(curproxy, PR_CAP_FE, file, linenum, args[0], NULL))
|
if (warnifnotcap(curproxy, PR_CAP_FE, file, linenum, args[0], NULL))
|
||||||
err_code |= ERR_WARN;
|
err_code |= ERR_WARN;
|
||||||
@ -8565,10 +8499,6 @@ out_uri_auth_compat:
|
|||||||
curproxy->id);
|
curproxy->id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (curproxy->appsession_name) {
|
|
||||||
Warning("Proxy '%s': appsession will not work correctly in multi-process mode.\n",
|
|
||||||
curproxy->id);
|
|
||||||
}
|
|
||||||
if (!LIST_ISEMPTY(&curproxy->sticking_rules)) {
|
if (!LIST_ISEMPTY(&curproxy->sticking_rules)) {
|
||||||
Warning("Proxy '%s': sticking rules will not work correctly in multi-process mode.\n",
|
Warning("Proxy '%s': sticking rules will not work correctly in multi-process mode.\n",
|
||||||
curproxy->id);
|
curproxy->id);
|
||||||
|
@ -56,7 +56,6 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <common/appsession.h>
|
|
||||||
#include <common/base64.h>
|
#include <common/base64.h>
|
||||||
#include <common/cfgparse.h>
|
#include <common/cfgparse.h>
|
||||||
#include <common/chunk.h>
|
#include <common/chunk.h>
|
||||||
@ -745,7 +744,6 @@ void init(int argc, char **argv)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
have_appsession = 0;
|
|
||||||
global.maxsock = 10; /* reserve 10 fds ; will be incremented by socket eaters */
|
global.maxsock = 10; /* reserve 10 fds ; will be incremented by socket eaters */
|
||||||
|
|
||||||
init_default_instance();
|
init_default_instance();
|
||||||
@ -825,9 +823,6 @@ void init(int argc, char **argv)
|
|||||||
init_51degrees();
|
init_51degrees();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (have_appsession)
|
|
||||||
appsession_init();
|
|
||||||
|
|
||||||
if (start_checks() < 0)
|
if (start_checks() < 0)
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
||||||
@ -1343,8 +1338,6 @@ void deinit(void)
|
|||||||
deinit_stick_rules(&p->storersp_rules);
|
deinit_stick_rules(&p->storersp_rules);
|
||||||
deinit_stick_rules(&p->sticking_rules);
|
deinit_stick_rules(&p->sticking_rules);
|
||||||
|
|
||||||
free(p->appsession_name);
|
|
||||||
|
|
||||||
h = p->req_cap;
|
h = p->req_cap;
|
||||||
while (h) {
|
while (h) {
|
||||||
h_next = h->next;
|
h_next = h->next;
|
||||||
@ -1490,17 +1483,11 @@ void deinit(void)
|
|||||||
pool_destroy2(pool2_requri);
|
pool_destroy2(pool2_requri);
|
||||||
pool_destroy2(pool2_task);
|
pool_destroy2(pool2_task);
|
||||||
pool_destroy2(pool2_capture);
|
pool_destroy2(pool2_capture);
|
||||||
pool_destroy2(pool2_appsess);
|
|
||||||
pool_destroy2(pool2_pendconn);
|
pool_destroy2(pool2_pendconn);
|
||||||
pool_destroy2(pool2_sig_handlers);
|
pool_destroy2(pool2_sig_handlers);
|
||||||
pool_destroy2(pool2_hdr_idx);
|
pool_destroy2(pool2_hdr_idx);
|
||||||
pool_destroy2(pool2_http_txn);
|
pool_destroy2(pool2_http_txn);
|
||||||
|
|
||||||
if (have_appsession) {
|
|
||||||
pool_destroy2(apools.serverid);
|
|
||||||
pool_destroy2(apools.sessid);
|
|
||||||
}
|
|
||||||
|
|
||||||
deinit_pollers();
|
deinit_pollers();
|
||||||
} /* end deinit() */
|
} /* end deinit() */
|
||||||
|
|
||||||
@ -1886,8 +1873,6 @@ int main(int argc, char **argv)
|
|||||||
*/
|
*/
|
||||||
run_poll_loop();
|
run_poll_loop();
|
||||||
|
|
||||||
/* Free all Hash Keys and all Hash elements */
|
|
||||||
appsession_cleanup();
|
|
||||||
/* Do some cleanup */
|
/* Do some cleanup */
|
||||||
deinit();
|
deinit();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user