-
Notifications
You must be signed in to change notification settings - Fork 381
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vrt_var: Make req.ttl and req.grace unsettable
req.ttl and req.grace are NAN when unset
- Loading branch information
Showing
6 changed files
with
68 additions
and
7 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
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
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
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
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,37 @@ | ||
varnishtest "unset req.ttl and req.grace" | ||
|
||
server s1 { | ||
rxreq | ||
expect req.http.ttl-initial == "NAN" | ||
expect req.http.grace-initial == "NAN" | ||
expect req.http.ttl-set == 0.000 | ||
expect req.http.grace-set == 0.000 | ||
expect req.http.ttl-unset == "NAN" | ||
expect req.http.grace-unset == "NAN" | ||
txresp | ||
} -start | ||
|
||
varnish v1 -vcl+backend { | ||
sub vcl_recv { | ||
set req.http.ttl-initial = req.ttl; | ||
set req.http.grace-initial = req.grace; | ||
|
||
set req.ttl = 0s; | ||
set req.grace = 0s; | ||
|
||
set req.http.ttl-set = req.ttl; | ||
set req.http.grace-set = req.grace; | ||
|
||
unset req.ttl; | ||
unset req.grace; | ||
|
||
set req.http.ttl-unset = req.ttl; | ||
set req.http.grace-unset = req.grace; | ||
} | ||
} -start | ||
|
||
client c1 -repeat 2 { | ||
txreq | ||
rxresp | ||
expect resp.status == 200 | ||
} -run |
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