};
struct arg {
- int type; /* argument type */
- union arg_data data; /* argument data */
+ unsigned char type; /* argument type, ARGT_* */
+ unsigned char unresolved; /* argument contains a string in <str> that must be resolved and freed */
+ union arg_data data; /* argument data */
};
for (arg = expr->args; arg; arg++) {
if (arg->type == ARGT_STOP)
break;
- if (arg->type == ARGT_FE || arg->type == ARGT_BE ||
- arg->type == ARGT_TAB || arg->type == ARGT_SRV ||
- arg->type == ARGT_USR || arg->type == ARGT_STR) {
+ if (arg->type == ARGT_STR || arg->unresolved) {
free(arg->data.str.str);
arg->data.str.str = NULL;
+ arg->unresolved = 0;
}
arg++;
}
for (arg = expr->args; arg; arg++) {
if (arg->type == ARGT_STOP)
break;
+ else if (!arg->unresolved)
+ continue;
else if (arg->type == ARGT_SRV) {
struct proxy *px;
struct server *srv;
}
free(expr->args->data.str.str);
+ expr->args->data.str.str = NULL;
+ arg->unresolved = 0;
expr->args->data.srv = srv;
}
else if (arg->type == ARGT_FE) {
}
free(expr->args->data.str.str);
+ expr->args->data.str.str = NULL;
+ arg->unresolved = 0;
expr->args->data.prx = prx;
}
else if (arg->type == ARGT_BE) {
}
free(expr->args->data.str.str);
+ expr->args->data.str.str = NULL;
+ arg->unresolved = 0;
expr->args->data.prx = prx;
}
else if (arg->type == ARGT_TAB) {
}
free(expr->args->data.str.str);
+ expr->args->data.str.str = NULL;
+ arg->unresolved = 0;
expr->args->data.prx = prx;
}
else if (arg->type == ARGT_USR) {
}
free(expr->args->data.str.str);
+ expr->args->data.str.str = NULL;
+ arg->unresolved = 0;
expr->args->data.usr = ul;
}
} /* end of args processing */
return;
while (p->type != ARGT_STOP) {
- if (p->type == ARGT_FE || p->type == ARGT_BE ||
- p->type == ARGT_TAB || p->type == ARGT_SRV ||
- p->type == ARGT_USR || p->type == ARGT_STR) {
+ if (p->type == ARGT_STR || p->unresolved) {
free(p->data.str.str);
p->data.str.str = NULL;
+ p->unresolved = 0;
}
p++;
}