Commit ccf6df17 authored by Cecilie Fritzvold's avatar Cecilie Fritzvold

Use purge in function names instead of repurge and move VRT_purge to cache_vrt.c.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@1765 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 776a5212
...@@ -360,6 +360,7 @@ struct bereq *vbe_new_bereq(void); ...@@ -360,6 +360,7 @@ struct bereq *vbe_new_bereq(void);
void vbe_free_bereq(struct bereq *bereq); void vbe_free_bereq(struct bereq *bereq);
/* cache_ban.c */ /* cache_ban.c */
void AddBan(const char *);
void BAN_Init(void); void BAN_Init(void);
void cli_func_url_purge(struct cli *cli, char **av, void *priv); void cli_func_url_purge(struct cli *cli, char **av, void *priv);
void BAN_NewObj(struct object *o); void BAN_NewObj(struct object *o);
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
#include "shmlog.h" #include "shmlog.h"
#include "cli_priv.h" #include "cli_priv.h"
#include "cache.h" #include "cache.h"
#include "vrt.h"
struct ban { struct ban {
TAILQ_ENTRY(ban) list; TAILQ_ENTRY(ban) list;
...@@ -53,7 +52,7 @@ static TAILQ_HEAD(,ban) ban_head = TAILQ_HEAD_INITIALIZER(ban_head); ...@@ -53,7 +52,7 @@ static TAILQ_HEAD(,ban) ban_head = TAILQ_HEAD_INITIALIZER(ban_head);
static unsigned ban_next; static unsigned ban_next;
static struct ban *ban_start; static struct ban *ban_start;
static void void
AddBan(const char *regexp) AddBan(const char *regexp)
{ {
struct ban *b; struct ban *b;
...@@ -115,9 +114,3 @@ BAN_Init(void) ...@@ -115,9 +114,3 @@ BAN_Init(void)
AddBan("a"); AddBan("a");
} }
void
VRT_repurge(const char *regexp)
{
AddBan(regexp);
}
...@@ -513,3 +513,12 @@ VRT_IP_string(struct sess *sp, struct sockaddr *sa) ...@@ -513,3 +513,12 @@ VRT_IP_string(struct sess *sp, struct sockaddr *sa)
strcat(q, p); strcat(q, p);
return (q); return (q);
} }
/*--------------------------------------------------------------------*/
void
VRT_purge(const char *regexp)
{
AddBan(regexp);
}
...@@ -70,7 +70,7 @@ int VRT_re_match(const char *, void *re); ...@@ -70,7 +70,7 @@ int VRT_re_match(const char *, void *re);
int VRT_re_test(struct vsb *, const char *, int sub); int VRT_re_test(struct vsb *, const char *, int sub);
const char *VRT_regsub(struct sess *sp, const char *, void *, const char *); 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); void VRT_count(struct sess *, unsigned);
int VRT_rewrite(const char *, const char *); int VRT_rewrite(const char *, const char *);
......
...@@ -264,11 +264,11 @@ parse_remove(struct tokenlist *tl) ...@@ -264,11 +264,11 @@ parse_remove(struct tokenlist *tl)
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
static void static void
parse_repurge(struct tokenlist *tl) parse_purge(struct tokenlist *tl)
{ {
vcc_NextToken(tl); vcc_NextToken(tl);
Fb(tl, 0, "VRT_repurge("); Fb(tl, 0, "VRT_purge(");
Expect(tl, '('); Expect(tl, '(');
vcc_NextToken(tl); vcc_NextToken(tl);
...@@ -299,7 +299,7 @@ static struct action_table { ...@@ -299,7 +299,7 @@ static struct action_table {
{ "call", parse_call }, { "call", parse_call },
{ "set", parse_set }, { "set", parse_set },
{ "remove", parse_remove }, { "remove", parse_remove },
{ "purge", parse_repurge }, { "purge", parse_purge },
{ NULL, NULL } { NULL, NULL }
}; };
......
...@@ -426,7 +426,7 @@ vcl_output_lang_h(struct vsb *sb) ...@@ -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, "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, "const char *VRT_regsub(struct sess *sp, const char *, void *, const char *);\n");
vsb_cat(sb, "\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, "\n");
vsb_cat(sb, "void VRT_count(struct sess *, unsigned);\n"); vsb_cat(sb, "void VRT_count(struct sess *, unsigned);\n");
vsb_cat(sb, "int VRT_rewrite(const char *, const char *);\n"); vsb_cat(sb, "int VRT_rewrite(const char *, const char *);\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment