if (err_code & ERR_FATAL)
goto out;
}
- else if (!strcmp(args[0], "reqsetbe")) { /* switch the backend from a regex, respecting case */
- err_code |= create_cond_regex_rule(file, linenum, curproxy,
- SMP_OPT_DIR_REQ, ACT_SETBE, 0,
- args[0], args[1], args[2], (const char **)args+3);
- if (err_code & ERR_FATAL)
- goto out;
-
- if (!already_warned(WARN_REQSETBE_DEPRECATED))
- Warning("parsing [%s:%d] : The '%s' directive is now deprecated in favor of the more efficient 'use_backend' which uses a different but more powerful syntax. Future versions will not support '%s' anymore, you should convert it now!\n", file, linenum, args[0], args[0]);
- }
- else if (!strcmp(args[0], "reqisetbe")) { /* switch the backend from a regex, ignoring case */
- err_code |= create_cond_regex_rule(file, linenum, curproxy,
- SMP_OPT_DIR_REQ, ACT_SETBE, REG_ICASE,
- args[0], args[1], args[2], (const char **)args+3);
- if (err_code & ERR_FATAL)
- goto out;
-
- if (!already_warned(WARN_REQSETBE_DEPRECATED))
- Warning("parsing [%s:%d] : The '%s' directive is now deprecated in favor of the more efficient 'use_backend' which uses a different but more powerful syntax. Future versions will not support '%s' anymore, you should convert it now!\n", file, linenum, args[0], args[0]);
- }
else if (!strcmp(args[0], "reqirep")) { /* replace request header from a regex, ignoring case */
if (*(args[2]) == 0) {
Alert("parsing [%s:%d] : '%s' expects <search> and <replace> as arguments.\n",
* that it is always guaranteed that a backend pointed to by a frontend is
* bound to all of its processes. After that, if the target is a "listen"
* instance, the function recursively descends the target's own targets along
- * default_backend, use_backend rules, and reqsetbe rules. Since the bits are
+ * default_backend and use_backend rules. Since the bits are
* checked first to ensure that <to> is already bound to all processes of
* <from>, there is no risk of looping and we ensure to follow the shortest
* path to the destination.
void propagate_processes(struct proxy *from, struct proxy *to)
{
struct switching_rule *rule;
- struct hdr_exp *exp;
if (to) {
/* check whether we need to go down */
to = rule->be.backend;
propagate_processes(from, to);
}
-
- /* reqsetbe */
- for (exp = from->req_exp; exp != NULL; exp = exp->next) {
- if (exp->action != ACT_SETBE)
- continue;
- to = (struct proxy *)exp->replace;
- propagate_processes(from, to);
- }
}
/*
}
}
- /* find the target proxy in setbe */
- if (curproxy->mode == PR_MODE_HTTP && curproxy->req_exp != NULL) {
- /* map jump target for ACT_SETBE in req_rep chain */
- struct hdr_exp *exp;
- for (exp = curproxy->req_exp; exp != NULL; exp = exp->next) {
- struct proxy *target;
-
- if (exp->action != ACT_SETBE)
- continue;
-
- target = proxy_be_by_name(exp->replace);
- if (!target) {
- Alert("Proxy '%s': unable to find required setbe: '%s'.\n",
- curproxy->id, exp->replace);
- cfgerr++;
- } else if (target == curproxy) {
- Alert("Proxy '%s': loop detected for setbe: '%s'.\n",
- curproxy->id, exp->replace);
- cfgerr++;
- } else if (target->mode != PR_MODE_HTTP) {
- Alert("%s %s '%s' (%s:%d) tries to use incompatible %s %s '%s' (%s:%d) in a 'reqsetbe' rule (see 'mode').\n",
- proxy_mode_str(curproxy->mode), proxy_type_str(curproxy), curproxy->id,
- curproxy->conf.file, curproxy->conf.line,
- proxy_mode_str(target->mode), proxy_type_str(target), target->id,
- target->conf.file, target->conf.line);
- cfgerr++;
- } else {
- free((void *)exp->replace);
- exp->replace = (const char *)target;
- }
- }
- }
-
/* find the target proxy for 'use_backend' rules */
list_for_each_entry(rule, &curproxy->switching_rules, list) {
struct proxy *target;
*/
for (fe = proxy; fe; fe = fe->next) {
struct switching_rule *rule;
- struct hdr_exp *exp;
int found = 0;
if (!(fe->cap & PR_CAP_FE))
}
}
- /* check if a "reqsetbe" rule matches */
- for (exp = fe->req_exp; !found && exp; exp = exp->next) {
- if (exp->action == ACT_SETBE &&
- (struct proxy *)exp->replace == curproxy) {
- found = 1;
- break;
- }
- }
-
/* now we've checked all possible ways to reference a backend
* from a frontend.
*/
if (regex_exec_match2(exp->preg, cur_ptr, cur_end-cur_ptr, MAX_MATCH, pmatch, 0)) {
switch (exp->action) {
- case ACT_SETBE:
- /* It is not possible to jump a second time.
- * FIXME: should we return an HTTP/500 here so that
- * the admin knows there's a problem ?
- */
- if (s->be != strm_fe(s))
- break;
-
- /* Swithing Proxy */
- stream_set_backend(s, (struct proxy *)exp->replace);
- last_hdr = 1;
- break;
-
case ACT_ALLOW:
txn->flags |= TX_CLALLOW;
last_hdr = 1;
if (regex_exec_match2(exp->preg, cur_ptr, cur_end-cur_ptr, MAX_MATCH, pmatch, 0)) {
switch (exp->action) {
- case ACT_SETBE:
- /* It is not possible to jump a second time.
- * FIXME: should we return an HTTP/500 here so that
- * the admin knows there's a problem ?
- */
- if (s->be != strm_fe(s))
- break;
-
- /* Swithing Proxy */
- stream_set_backend(s, (struct proxy *)exp->replace);
- done = 1;
- break;
-
case ACT_ALLOW:
txn->flags |= TX_CLALLOW;
done = 1;