Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-weightadjust
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-weightadjust
Commits
cc1af142
Unverified
Commit
cc1af142
authored
Oct 28, 2021
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not need inline-C any more
parent
8d3bf9f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
wadj_basic.vtc
src/tests/wadj_basic.vtc
+5
-6
No files found.
src/tests/wadj_basic.vtc
View file @
cc1af142
...
@@ -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));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment