From 5871e1df450f58fa0998f4e386aae0654c088113 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 16 Dec 2011 15:23:14 +0100 Subject: 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. --- include/proto/pattern.h | 2 ++ src/pattern.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/proto/pattern.h b/include/proto/pattern.h index ea8cf0d..25a00d6 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 59ff010..bebeabe 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; -- 1.7.2.3