Do not need inline-C any more

parent 8d3bf9f9
...@@ -30,8 +30,7 @@ server s3 { ...@@ -30,8 +30,7 @@ server s3 {
varnish v1 -arg "-p vcc_allow_inline_c=true" -vcl+backend { varnish v1 -arg "-p vcc_allow_inline_c=true" -vcl+backend {
import ${vmod_weightadjust}; import ${vmod_weightadjust};
import vtc;
C{#include <unistd.h>}C
backend s1_hosthdr { backend s1_hosthdr {
.host = "${s1_addr}"; .host = "${s1_addr}";
...@@ -48,11 +47,11 @@ varnish v1 -arg "-p vcc_allow_inline_c=true" -vcl+backend { ...@@ -48,11 +47,11 @@ varnish v1 -arg "-p vcc_allow_inline_c=true" -vcl+backend {
sub vcl_recv { sub vcl_recv {
if (req.url == "/1") { if (req.url == "/1") {
C{sleep(1);}C vtc.sleep(1s);
foo.add_backend(backend=s1_hosthdr, weight=1, foo.add_backend(backend=s1_hosthdr, weight=1,
weight_update = "^X-Weight: (\d+\.\d+)", weight_update = "^X-Weight: (\d+\.\d+)",
interval = 1h); interval = 1h);
C{sleep(1);}C vtc.sleep(1s);
foo.remove_backend(backend=s1); foo.remove_backend(backend=s1);
return (synth(200)); return (synth(200));
} }
...@@ -61,7 +60,7 @@ varnish v1 -arg "-p vcc_allow_inline_c=true" -vcl+backend { ...@@ -61,7 +60,7 @@ varnish v1 -arg "-p vcc_allow_inline_c=true" -vcl+backend {
url = "/otherurl", url = "/otherurl",
weight_update = "inthebody.*(\d+\.\d+)", weight_update = "inthebody.*(\d+\.\d+)",
interval = 1h); interval = 1h);
C{sleep(1);}C vtc.sleep(1s);
return (synth(200)); return (synth(200));
} }
if (req.url == "/3") { if (req.url == "/3") {
...@@ -72,7 +71,7 @@ Host: weighthost ...@@ -72,7 +71,7 @@ Host: weighthost
"}, "},
weight_update = "^X-Weight: ([\d.]+)", weight_update = "^X-Weight: ([\d.]+)",
interval = 1h); interval = 1h);
C{sleep(1);}C vtc.sleep(1s);
return (synth(200)); return (synth(200));
} }
return (synth(400)); return (synth(400));
......
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