From: Willy Tarreau Date: Fri, 16 Dec 2011 14:23:14 +0000 (+0100) Subject: MINOR: pattern: export the global temporary pattern X-Git-Tag: v1.5-dev8~62 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5e6cc4aad8c7a7bd83f64e5a2a360db01bc5003f;p=thirdparty%2Fhaproxy.git MINOR: pattern: export the global temporary pattern The global pattern is used for pattern conversions. Export it under the name "temp_pattern" so that it can later be used by ACLs. --- diff --git a/include/proto/pattern.h b/include/proto/pattern.h index ea8cf0dfef..25a00d6f8b 100644 --- a/include/proto/pattern.h +++ b/include/proto/pattern.h @@ -25,6 +25,8 @@ #include #include +extern struct pattern temp_pattern; + struct pattern_expr *pattern_parse_expr(char **str, int *idx, char *err, int err_size); struct pattern *pattern_process(struct proxy *px, struct session *l4, void *l7, int dir, struct pattern_expr *expr, diff --git a/src/pattern.c b/src/pattern.c index 59ff010dd1..bebeabedbd 100644 --- a/src/pattern.c +++ b/src/pattern.c @@ -18,7 +18,7 @@ #include /* static structure used on pattern_process if

is NULL*/ -static struct pattern spattern; +struct pattern temp_pattern = { }; /* trash chunk used for pattern conversions */ static struct chunk trash_chunk; @@ -469,7 +469,7 @@ struct pattern *pattern_process(struct proxy *px, struct session *l4, void *l7, struct pattern_conv_expr *conv_expr; if (p == NULL) - p = &spattern; + p = &temp_pattern; if (!expr->fetch->process(px, l4, l7, dir, expr->arg_p, expr->arg_i, &p->data)) return NULL;