Commit b18dd05d authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

Retire debug.purge

We can directly use vmod-purge now.
parent 9a267ea8
...@@ -6,47 +6,47 @@ server s1 -repeat 12 { ...@@ -6,47 +6,47 @@ server s1 -repeat 12 {
} -start } -start
varnish v1 -arg "-p thread_pools=1" -vcl+backend { varnish v1 -arg "-p thread_pools=1" -vcl+backend {
import debug; import purge;
import vtc; import vtc;
sub vcl_recv { sub vcl_recv {
if (req.url == "recv") { debug.purge(); } if (req.url == "recv") { purge.hard(); }
if (req.url == "pass") { return (pass); } if (req.url == "pass") { return (pass); }
if (req.url == "purge") { return (purge); } if (req.url == "purge") { return (purge); }
if (req.url == "synth") { return (synth(200)); } if (req.url == "synth") { return (synth(200)); }
} }
sub vcl_hash { sub vcl_hash {
if (req.url == "hash") { debug.purge(); } if (req.url == "hash") { purge.hard(); }
} }
sub vcl_miss { sub vcl_miss {
if (req.url == "miss") { debug.purge(); } if (req.url == "miss") { purge.hard(); }
} }
sub vcl_hit { sub vcl_hit {
if (req.url == "hit") { debug.purge(); } if (req.url == "hit") { purge.hard(); }
} }
sub vcl_purge { sub vcl_purge {
if (req.url == "purge") { debug.purge(); } if (req.url == "purge") { purge.hard(); }
} }
sub vcl_pass { sub vcl_pass {
if (req.url == "pass") { debug.purge(); } if (req.url == "pass") { purge.hard(); }
} }
sub vcl_deliver { sub vcl_deliver {
if (req.url == "deliver") { debug.purge(); } if (req.url == "deliver") { purge.hard(); }
} }
sub vcl_synth { sub vcl_synth {
if (req.url == "synth") { debug.purge(); } if (req.url == "synth") { purge.hard(); }
} }
sub vcl_backend_fetch { sub vcl_backend_fetch {
if (bereq.url == "fetch") { debug.purge(); } if (bereq.url == "fetch") { purge.hard(); }
if (bereq.url == "error") { if (bereq.url == "error") {
set bereq.backend = vtc.no_backend(); set bereq.backend = vtc.no_backend();
} }
} }
sub vcl_backend_error { sub vcl_backend_error {
if (bereq.url == "error") { debug.purge(); } if (bereq.url == "error") { purge.hard(); }
} }
sub vcl_backend_response { sub vcl_backend_response {
if (bereq.url == "response") { debug.purge(); } if (bereq.url == "response") { purge.hard(); }
} }
} -start } -start
...@@ -58,49 +58,38 @@ logexpect l1 -v v1 { ...@@ -58,49 +58,38 @@ logexpect l1 -v v1 {
expect * 1002 Begin "bereq 1001 fetch" expect * 1002 Begin "bereq 1001 fetch"
expect * 1003 VCL_call HIT expect * 1003 VCL_call HIT
expect * = VCL_Log PURGE
expect * = VCL_call DELIVER expect * = VCL_call DELIVER
expect * 1004 VCL_call MISS expect * 1004 VCL_call MISS
expect * = VCL_Log PURGE
expect * = VCL_call DELIVER expect * = VCL_call DELIVER
expect * 1007 VCL_call RECV expect * 1007 VCL_call RECV
expect * = VCL_Log PURGE
expect * = VCL_Error purge expect * = VCL_Error purge
expect * = VCL_return fail expect * = VCL_return fail
expect * 1009 VCL_call HASH expect * 1009 VCL_call HASH
expect * = VCL_Log PURGE
expect * = VCL_Error purge expect * = VCL_Error purge
expect * = VCL_return fail expect * = VCL_return fail
expect * 1011 VCL_call PURGE expect * 1011 VCL_call PURGE
expect * = VCL_Log PURGE
expect * = VCL_Error purge expect * = VCL_Error purge
expect * 1013 VCL_call PASS expect * 1013 VCL_call PASS
expect * = VCL_Log PURGE
expect * = VCL_Error purge expect * = VCL_Error purge
expect * 1015 VCL_call DELIVER expect * 1015 VCL_call DELIVER
expect * = VCL_Log PURGE
expect * = VCL_Error purge expect * = VCL_Error purge
expect * 1018 VCL_call SYNTH expect * 1018 VCL_call SYNTH
expect * = VCL_Log PURGE
expect * = VCL_Error purge expect * = VCL_Error purge
expect * 1021 VCL_call BACKEND_FETCH expect * 1021 VCL_call BACKEND_FETCH
expect * = VCL_Log PURGE
expect * = VCL_Error purge expect * = VCL_Error purge
expect * 1024 VCL_call BACKEND_ERROR expect * 1024 VCL_call BACKEND_ERROR
expect * = VCL_Log PURGE
expect * = VCL_Error purge expect * = VCL_Error purge
expect * 1027 VCL_call BACKEND_RESPONSE expect * 1027 VCL_call BACKEND_RESPONSE
expect * = VCL_Log PURGE
expect * = VCL_Error purge expect * = VCL_Error purge
} -start } -start
......
...@@ -220,7 +220,3 @@ Returns the size in bytes of a collection of C-datatypes. ...@@ -220,7 +220,3 @@ Returns the size in bytes of a collection of C-datatypes.
* 'z' = size_t * 'z' = size_t
* 'o' = off_t * 'o' = off_t
* 'j' = intmax_t * 'j' = intmax_t
$Function VOID purge(DURATION ttl = 0, DURATION grace = 0, DURATION keep = 0)
Performs a purge, by default a hard purge where ttl, grace and keep are zero.
...@@ -594,13 +594,3 @@ vmod_typesize(VRT_CTX, VCL_STRING s) ...@@ -594,13 +594,3 @@ vmod_typesize(VRT_CTX, VCL_STRING s)
} }
return ((VCL_INT)i); return ((VCL_INT)i);
} }
VCL_VOID __match_proto__(td_debug_purge)
vmod_purge(VRT_CTX, double ttl, double grace, double keep)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
VSLb(ctx->vsl, SLT_VCL_Log, "PURGE");
VRT_purge(ctx, ttl, grace, keep);
}
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