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

Retire the obj.cacheable VCL variable. Whatever our thinking at the

time might have been, it clearly was woollen, and all it did was
confuse people.
parent c50858f2
......@@ -432,7 +432,6 @@ struct object {
unsigned response;
/* XXX: make bitmap */
unsigned cacheable;
unsigned gziped;
/* Bit positions in the gzip stream */
ssize_t gzip_start;
......
......@@ -476,7 +476,6 @@ ban_check_object(struct object *o, const struct sess *sp, int has_req)
return (0);
} else {
o->ttl = 0;
o->cacheable = 0;
oc->ban = NULL;
oc_updatemeta(oc);
/* BAN also changed, but that is not important any more */
......
......@@ -667,10 +667,7 @@ cnt_fetch(struct sess *sp)
sp->obj->xid = sp->xid;
sp->obj->response = sp->err_code;
sp->obj->cacheable = sp->wrk->cacheable;
sp->obj->grace = sp->wrk->grace;
if (sp->obj->ttl == 0. && sp->obj->grace == 0.)
sp->obj->cacheable = 0;
sp->obj->age = sp->wrk->age;
sp->obj->entered = sp->wrk->entered;
WS_Assert(sp->obj->ws_o);
......@@ -733,7 +730,6 @@ cnt_fetch(struct sess *sp)
WRONG("Illegal action in vcl_fetch{}");
}
sp->obj->cacheable = 1;
if (sp->wrk->cacheable) {
EXP_Insert(sp->obj);
AN(sp->obj->objcore);
......
......@@ -138,7 +138,6 @@ EXP_Insert(struct object *o)
oc = o->objcore;
CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
AssertObjBusy(o);
assert(o->cacheable);
HSH_Ref(oc);
assert(o->entered != 0 && !isnan(o->entered));
......
......@@ -362,8 +362,6 @@ HSH_Lookup(struct sess *sp, struct objhead **poh)
o = oc_getobj(sp->wrk, oc);
CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC);
if (!o->cacheable)
continue;
if (o->ttl == 0)
continue;
if (BAN_CheckObject(o, sp))
......@@ -579,7 +577,6 @@ HSH_Drop(struct sess *sp)
o = sp->obj;
CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC);
AssertObjPassOrBusy(o);
o->cacheable = 0;
o->ttl = 0;
if (o->objcore != NULL) /* Pass has no objcore */
HSH_Unbusy(sp);
......
......@@ -367,28 +367,6 @@ VRT_r_obj_ttl(const struct sess *sp)
return (sp->obj->ttl - sp->t_req);
}
/*--------------------------------------------------------------------*/
#define VOBJ(type,onm,field) \
void \
VRT_l_obj_##onm(const struct sess *sp, type a) \
{ \
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \
CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX */ \
sp->obj->field = a; \
} \
\
type \
VRT_r_obj_##onm(const struct sess *sp) \
{ \
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC); \
CHECK_OBJ_NOTNULL(sp->obj, OBJECT_MAGIC); /* XXX */ \
return (sp->obj->field); \
}
VOBJ(unsigned, cacheable, cacheable)
/*--------------------------------------------------------------------*/
void
......
......@@ -94,9 +94,6 @@ sub vcl_hash {
}
sub vcl_hit {
if (!obj.cacheable) {
return (pass);
}
return (deliver);
}
......
......@@ -13,7 +13,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_hit {
set obj.cacheable = false;
set obj.ttl = 0s;
return (restart);
}
} -start
......
......@@ -30,7 +30,6 @@ varnish v1 -vcl+backend {
sub vcl_hit {
if (req.request == "POST") {
/* Get rid of this object */
set obj.cacheable = false;
set obj.ttl = 0s;
return (pass);
}
......
......@@ -63,27 +63,27 @@ varnish v1 -vcl {
varnish v1 -badvcl {
backend b { .host = "127.0.0.1"; }
sub vcl_fetch { set obj.cacheable += 1; }
sub vcl_fetch { set beresp.do_gzip += 1; }
}
varnish v1 -vcl {
backend b { .host = "127.0.0.1"; }
sub vcl_fetch { set beresp.cacheable = true; }
sub vcl_fetch { set beresp.do_gzip = true; }
}
varnish v1 -vcl {
backend b { .host = "127.0.0.1"; }
sub vcl_fetch { set beresp.cacheable = false; }
sub vcl_fetch { set beresp.do_gzip = false; }
}
varnish v1 -badvcl {
backend b { .host = "127.0.0.1"; }
sub vcl_fetch { set beresp.cacheable = mu; }
sub vcl_fetch { set beresp.do_gzip = mu; }
}
varnish v1 -badvcl {
backend b { .host = "127.0.0.1"; }
sub vcl_fetch { unset beresp.cacheable; }
sub vcl_fetch { unset beresp.do_gzip; }
}
varnish v1 -badvcl {
......
......@@ -416,7 +416,9 @@ varnish_stop(struct varnish *v)
vtc_log(v->vl, 2, "Stop");
(void)varnish_ask_cli(v, "stop", NULL);
while (1) {
r = NULL;
(void)varnish_ask_cli(v, "status", &r);
AN(r);
if (!strcmp(r, "Child in state stopped"))
break;
free(r);
......
......@@ -382,12 +382,6 @@ sp_variables = (
( 'error',), # XXX ?
'const struct sess *'
),
('obj.cacheable',
'BOOL',
( 'hit',),
( 'hit',),
'const struct sess *'
),
('obj.ttl',
'DURATION',
( 'hit', 'error',),
......
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