From 5aa0019b6dd74bd0c585c3a8e58bbb55ed24d0e9 Mon Sep 17 00:00:00 2001 From: cecilihf Date: Wed, 25 Jul 2007 11:09:06 +0000 Subject: [PATCH] Use purge in function names instead of repurge and move VRT_purge to cache_vrt.c. git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@1765 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/cache.h | 1 + varnish-cache/bin/varnishd/cache_ban.c | 9 +-------- varnish-cache/bin/varnishd/cache_vrt.c | 9 +++++++++ varnish-cache/include/vrt.h | 2 +- varnish-cache/lib/libvcl/vcc_action.c | 6 +++--- varnish-cache/lib/libvcl/vcc_fixed_token.c | 2 +- 6 files changed, 16 insertions(+), 13 deletions(-) diff --git a/varnish-cache/bin/varnishd/cache.h b/varnish-cache/bin/varnishd/cache.h index f8fcf19d..e2da5bf2 100644 --- a/varnish-cache/bin/varnishd/cache.h +++ b/varnish-cache/bin/varnishd/cache.h @@ -360,6 +360,7 @@ struct bereq *vbe_new_bereq(void); void vbe_free_bereq(struct bereq *bereq); /* cache_ban.c */ +void AddBan(const char *); void BAN_Init(void); void cli_func_url_purge(struct cli *cli, char **av, void *priv); void BAN_NewObj(struct object *o); diff --git a/varnish-cache/bin/varnishd/cache_ban.c b/varnish-cache/bin/varnishd/cache_ban.c index ffc60377..e56c6cbd 100644 --- a/varnish-cache/bin/varnishd/cache_ban.c +++ b/varnish-cache/bin/varnishd/cache_ban.c @@ -40,7 +40,6 @@ #include "shmlog.h" #include "cli_priv.h" #include "cache.h" -#include "vrt.h" struct ban { TAILQ_ENTRY(ban) list; @@ -53,7 +52,7 @@ static TAILQ_HEAD(,ban) ban_head = TAILQ_HEAD_INITIALIZER(ban_head); static unsigned ban_next; static struct ban *ban_start; -static void +void AddBan(const char *regexp) { struct ban *b; @@ -115,9 +114,3 @@ BAN_Init(void) AddBan("a"); } - -void -VRT_repurge(const char *regexp) -{ - AddBan(regexp); -} diff --git a/varnish-cache/bin/varnishd/cache_vrt.c b/varnish-cache/bin/varnishd/cache_vrt.c index 2518a4c4..04b92f02 100644 --- a/varnish-cache/bin/varnishd/cache_vrt.c +++ b/varnish-cache/bin/varnishd/cache_vrt.c @@ -513,3 +513,12 @@ VRT_IP_string(struct sess *sp, struct sockaddr *sa) strcat(q, p); return (q); } + +/*--------------------------------------------------------------------*/ + +void +VRT_purge(const char *regexp) +{ + + AddBan(regexp); +} diff --git a/varnish-cache/include/vrt.h b/varnish-cache/include/vrt.h index b3f7e090..2cf5f7ef 100644 --- a/varnish-cache/include/vrt.h +++ b/varnish-cache/include/vrt.h @@ -70,7 +70,7 @@ int VRT_re_match(const char *, void *re); int VRT_re_test(struct vsb *, const char *, int sub); const char *VRT_regsub(struct sess *sp, const char *, void *, const char *); -void VRT_repurge(const char *); +void VRT_purge(const char *); void VRT_count(struct sess *, unsigned); int VRT_rewrite(const char *, const char *); diff --git a/varnish-cache/lib/libvcl/vcc_action.c b/varnish-cache/lib/libvcl/vcc_action.c index de9a7e19..1887ba85 100644 --- a/varnish-cache/lib/libvcl/vcc_action.c +++ b/varnish-cache/lib/libvcl/vcc_action.c @@ -264,11 +264,11 @@ parse_remove(struct tokenlist *tl) /*--------------------------------------------------------------------*/ static void -parse_repurge(struct tokenlist *tl) +parse_purge(struct tokenlist *tl) { vcc_NextToken(tl); - Fb(tl, 0, "VRT_repurge("); + Fb(tl, 0, "VRT_purge("); Expect(tl, '('); vcc_NextToken(tl); @@ -299,7 +299,7 @@ static struct action_table { { "call", parse_call }, { "set", parse_set }, { "remove", parse_remove }, - { "purge", parse_repurge }, + { "purge", parse_purge }, { NULL, NULL } }; diff --git a/varnish-cache/lib/libvcl/vcc_fixed_token.c b/varnish-cache/lib/libvcl/vcc_fixed_token.c index 630d2934..07e30c56 100644 --- a/varnish-cache/lib/libvcl/vcc_fixed_token.c +++ b/varnish-cache/lib/libvcl/vcc_fixed_token.c @@ -426,7 +426,7 @@ vcl_output_lang_h(struct vsb *sb) vsb_cat(sb, "int VRT_re_test(struct vsb *, const char *, int sub);\n"); vsb_cat(sb, "const char *VRT_regsub(struct sess *sp, const char *, void *, const char *);\n"); vsb_cat(sb, "\n"); - vsb_cat(sb, "void VRT_repurge(const char *);\n"); + vsb_cat(sb, "void VRT_purge(const char *);\n"); vsb_cat(sb, "\n"); vsb_cat(sb, "void VRT_count(struct sess *, unsigned);\n"); vsb_cat(sb, "int VRT_rewrite(const char *, const char *);\n"); -- 2.39.5