-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Work around arguably wrong event order in Varnish-Cache
Ref varnishcache/varnish-cache#4037 Closes #107
- Loading branch information
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
varnishtest "regression test issue #107 dom_release() from unref_domains" | ||
|
||
feature cmd "getent hosts localhost www.localhost img.localhost" | ||
|
||
server s1 { | ||
rxreq | ||
expect req.http.Host == localhost | ||
txresp | ||
|
||
rxreq | ||
expect req.http.Host == www.localhost | ||
txresp | ||
|
||
rxreq | ||
expect req.http.Host == www.localhost | ||
txresp | ||
} -start | ||
|
||
varnish v1 -vcl+backend { | ||
import ${vmod_dynamic}; | ||
|
||
sub vcl_init { | ||
new d1 = dynamic.director( | ||
port = "${s1_port}", | ||
ttl = 1m, | ||
domain_usage_timeout = 900ms); | ||
} | ||
|
||
sub vcl_recv { | ||
set req.backend_hint = d1.backend(req.http.Host); | ||
return (pass); | ||
} | ||
|
||
sub vcl_backend_error { | ||
# the director may resolve ::1 first | ||
return (retry); | ||
} | ||
} -start | ||
|
||
client c1 { | ||
txreq -hdr "Host: localhost" | ||
rxresp | ||
expect resp.status == 200 | ||
} -run | ||
|
||
delay 1 | ||
|
||
varnish v1 -vcl {backend proforma none;} | ||
|
||
varnish v1 -cliok "vcl.state vcl1 cold" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters