Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
2e22c1c3
Commit
2e22c1c3
authored
Sep 21, 2015
by
Poul-Henning Kamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
I broke discarding old objects when they have been replaced
in
c709e110
. Spotted by: Martin Test-case by: Martin
parent
75b1392b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
2 deletions
+56
-2
cache_fetch.c
bin/varnishd/cache/cache_fetch.c
+6
-2
c00072.vtc
bin/varnishtest/tests/c00072.vtc
+50
-0
No files found.
bin/varnishd/cache/cache_fetch.c
View file @
2e22c1c3
...
...
@@ -186,7 +186,8 @@ vbf_stp_mkbereq(const struct worker *wrk, struct busyobj *bo)
}
else
AZ
(
bo
->
stale_oc
);
if
(
bo
->
stale_oc
!=
NULL
)
{
if
(
bo
->
stale_oc
!=
NULL
&&
ObjCheckFlag
(
bo
->
wrk
,
bo
->
stale_oc
,
OF_IMSCAND
))
{
q
=
HTTP_GetHdrPack
(
bo
->
wrk
,
bo
->
stale_oc
,
H_Last_Modified
);
if
(
q
!=
NULL
)
http_PrintfHeader
(
bo
->
bereq0
,
...
...
@@ -393,7 +394,8 @@ vbf_stp_startfetch(struct worker *wrk, struct busyobj *bo)
AZ
(
bo
->
was_304
);
if
(
http_IsStatus
(
bo
->
beresp
,
304
))
{
if
(
bo
->
stale_oc
!=
NULL
)
{
if
(
bo
->
stale_oc
!=
NULL
&&
ObjCheckFlag
(
bo
->
wrk
,
bo
->
stale_oc
,
OF_IMSCAND
))
{
if
(
ObjCheckFlag
(
bo
->
wrk
,
bo
->
stale_oc
,
OF_CHGGZIP
))
{
/*
* If we changed the gzip status of the object
...
...
@@ -904,12 +906,14 @@ vbf_fetch_thread(struct worker *wrk, void *priv)
bo
->
wrk
=
wrk
;
wrk
->
vsl
=
bo
->
vsl
;
#if 0
if (bo->stale_oc != NULL) {
CHECK_OBJ_NOTNULL(bo->stale_oc, OBJCORE_MAGIC);
/* We don't want the oc/stevedore ops in fetching thread */
if (!ObjCheckFlag(wrk, bo->stale_oc, OF_IMSCAND))
(void)HSH_DerefObjCore(wrk, &bo->stale_oc);
}
#endif
while
(
stp
!=
F_STP_DONE
)
{
CHECK_OBJ_NOTNULL
(
bo
,
BUSYOBJ_MAGIC
);
...
...
bin/varnishtest/tests/c00072.vtc
0 → 100644
View file @
2e22c1c3
varnishtest "purge stale on refresh with and without IMS"
server s1 {
rxreq
txresp -hdr "foo: bar"
rxreq
txresp -hdr "foo: bar" -hdr {ETag: "asdf"}
rxreq
txresp -hdr "foo: baz"
rxreq
expect req.http.if-none-match == {"asdf"}
txresp -status 304 -nolen -hdr "foo: baz"
} -start
varnish v1 -vcl+backend {
sub vcl_backend_response {
set beresp.ttl = 0.1s;
set beresp.grace = 0s;
set beresp.keep = 60s;
}
} -start
client c1 {
txreq -url /no-ims
rxresp
expect resp.http.foo == "bar"
txreq -url /ims
rxresp
expect resp.http.foo == "bar"
} -run
# Wait for ttl to expire on both objects
delay 0.2
varnish v1 -expect n_object == 2
client c1 {
txreq -url /no-ims
rxresp
expect resp.http.foo == "baz"
txreq -url /ims
rxresp
expect resp.http.foo == "baz"
} -run
# Make sure expiry is done
delay 1
# Only one of each of /no-ims and /ims should be left
varnish v1 -expect n_object == 2
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