Commit 11834535 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Insert persistent objects with a refcount of one for the hash-tree.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4127 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 370d58ce
......@@ -620,7 +620,8 @@ SMP_Fixup(struct sess *sp, struct objhead *oh, struct objcore *oc)
AN(oc->flags & OC_F_PERSISTENT);
oc->flags &= ~OC_F_PERSISTENT;
oc->obj->refcnt = 0;
/* refcnt is one because the object is in the hash */
oc->obj->refcnt = 1;
oc->obj->objcore = oc;
oc->obj->objhead = oh;
oc->obj->ban = oc->ban;
......
# $Id$
test "Check object references"
shell "rm -f /tmp/__v1/_.per"
server s1 {
rxreq
txresp -hdr "Foo: foo"
rxreq
txresp -hdr "Bar: bar"
} -start
varnish v1 \
-arg "-pdiag_bitmap=0x20000" \
-arg "-spersistent,/tmp/__v1/_.per,10m" \
-vcl+backend { } -start
client c1 {
txreq -url "/foo"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1001"
expect resp.http.foo == "foo"
} -run
varnish v1 -expect n_object == 1
client c1 {
txreq -url "/bar"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "1002"
expect resp.http.bar == "bar"
} -run
varnish v1 -expect n_object == 2
varnish v1 -cliok stop
varnish v1 -cliok start -cliok "debug.xid 2000"
varnish v1 -expect n_object == 2
client c1 {
txreq -url "/foo"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "2001 1001"
expect resp.http.foo == "foo"
} -run
varnish v1 -expect n_object == 2
client c1 {
txreq -url "/bar"
rxresp
expect resp.status == 200
expect resp.http.X-Varnish == "2002 1002"
expect resp.http.bar == "bar"
} -run
varnish v1 -expect n_object == 2
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