]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: config: remove appsession initialization
authorWilly Tarreau <w@1wt.eu>
Mon, 10 Aug 2015 17:04:29 +0000 (19:04 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 10 Aug 2015 17:16:18 +0000 (19:16 +0200)
Now it asks to check the documentation.

src/cfgparse.c
src/haproxy.c

index 08adccdc124658bf6217611ea3e1005bba7fa10c..516580873b51153cdd4a46d30e0750abd5c90287 100644 (file)
@@ -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 */
-               int cur_arg;
-
-               if (curproxy == &defproxy) {
-                       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 */
+               Alert("parsing [%s:%d] : '%s' is not supported anymore, please check the documentation.\n", file, linenum, args[0]);
+               err_code |= ERR_ALERT | ERR_FATAL;
+               goto out;
+       }
        else if (!strcmp(args[0], "capture")) {
                if (warnifnotcap(curproxy, PR_CAP_FE, file, linenum, args[0], NULL))
                        err_code |= ERR_WARN;
@@ -8565,10 +8499,6 @@ out_uri_auth_compat:
                                                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)) {
                                Warning("Proxy '%s': sticking rules will not work correctly in multi-process mode.\n",
                                        curproxy->id);
index 4b4fdee70b8f51e22f4b329943627bdcf42b0d1b..88947085f38f6fadf91d986ee33d5299895d92d1 100644 (file)
@@ -56,7 +56,6 @@
 #include <assert.h>
 #endif
 
-#include <common/appsession.h>
 #include <common/base64.h>
 #include <common/cfgparse.h>
 #include <common/chunk.h>
@@ -745,7 +744,6 @@ void init(int argc, char **argv)
                exit(1);
        }
 
-       have_appsession = 0;
        global.maxsock = 10; /* reserve 10 fds ; will be incremented by socket eaters */
 
        init_default_instance();
@@ -825,9 +823,6 @@ void init(int argc, char **argv)
        init_51degrees();
 #endif
 
-       if (have_appsession)
-               appsession_init();
-
        if (start_checks() < 0)
                exit(1);
 
@@ -1343,8 +1338,6 @@ void deinit(void)
                deinit_stick_rules(&p->storersp_rules);
                deinit_stick_rules(&p->sticking_rules);
 
-               free(p->appsession_name);
-
                h = p->req_cap;
                while (h) {
                        h_next = h->next;
@@ -1490,17 +1483,11 @@ void deinit(void)
        pool_destroy2(pool2_requri);
        pool_destroy2(pool2_task);
        pool_destroy2(pool2_capture);
-       pool_destroy2(pool2_appsess);
        pool_destroy2(pool2_pendconn);
        pool_destroy2(pool2_sig_handlers);
        pool_destroy2(pool2_hdr_idx);
        pool_destroy2(pool2_http_txn);
     
-       if (have_appsession) {
-               pool_destroy2(apools.serverid);
-               pool_destroy2(apools.sessid);
-       }
-
        deinit_pollers();
 } /* end deinit() */
 
@@ -1886,8 +1873,6 @@ int main(int argc, char **argv)
         */
        run_poll_loop();
 
-       /* Free all Hash Keys and all Hash elements */
-       appsession_cleanup();
        /* Do some cleanup */ 
        deinit();