Commit 5a1cdf99 authored by Arianna Aondio's avatar Arianna Aondio

Merge branch 'master' of git.varnish-cache.org:varnish-cache

parents 93a2f064 14a926bd
......@@ -204,20 +204,6 @@ VRT_r_beresp_##field(VRT_CTX) \
/*--------------------------------------------------------------------*/
void
VRT_l_bereq_uncacheable(VRT_CTX, unsigned a)
{
CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
CHECK_OBJ_NOTNULL(ctx->bo, BUSYOBJ_MAGIC);
if (ctx->bo->do_pass && !a) {
VSLb(ctx->vsl, SLT_VCL_Error,
"Ignoring attempt to reset bereq.uncacheable");
} else if (a) {
ctx->bo->do_pass = 1;
}
}
unsigned
VRT_r_bereq_uncacheable(VRT_CTX)
{
......
......@@ -193,7 +193,8 @@ static int /*__match_proto__ (VSLQ_dispatch_f)*/
accumulate(struct VSL_data *vsl, struct VSL_transaction * const pt[],
void *priv)
{
int i, j, tag, skip, match, hit;
int i, tag, skip, match, hit;
unsigned u;
double value;
struct VSL_transaction *tr;
......@@ -259,13 +260,15 @@ accumulate(struct VSL_data *vsl, struct VSL_transaction * const pt[],
/* phase out old data */
if (nhist == HIST_N) {
j = rr_hist[next_hist];
if (j < 0) {
assert(bucket_miss[-j] > 0);
bucket_miss[-j]--;
u = rr_hist[next_hist];
if (u >= hist_buckets) {
u -= hist_buckets;
assert(u < hist_buckets);
assert(bucket_hit[u] > 0);
bucket_hit[u]--;
} else {
assert(bucket_hit[j] > 0);
bucket_hit[j]--;
assert(bucket_miss[u] > 0);
bucket_miss[u]--;
}
} else {
++nhist;
......@@ -274,10 +277,10 @@ accumulate(struct VSL_data *vsl, struct VSL_transaction * const pt[],
/* phase in new data */
if (hit) {
bucket_hit[i]++;
rr_hist[next_hist] = i;
rr_hist[next_hist] = i + hist_buckets;
} else {
bucket_miss[i]++;
rr_hist[next_hist] = -i;
rr_hist[next_hist] = i;
}
if (++next_hist == HIST_N) {
next_hist = 0;
......
......@@ -22,6 +22,7 @@ varnish v1 -arg "-i J.F.Nobody" -vcl+backend {
set resp.http.esi = req.esi;
set resp.http.be = req.backend_hint;
set resp.http.c_id = client.identity;
if (obj.uncacheable) { }
}
sub vcl_backend_response {
......@@ -41,7 +42,6 @@ varnish v1 -arg "-i J.F.Nobody" -vcl+backend {
sub vcl_hit {
if (obj.proto) { }
if (obj.reason) { }
if (obj.uncacheable) { }
if (obj.keep > 1m) { }
if (obj.grace < 3m) {
return (deliver);
......@@ -52,7 +52,6 @@ varnish v1 -arg "-i J.F.Nobody" -vcl+backend {
}
sub vcl_backend_fetch {
set bereq.uncacheable = false;
if (bereq.between_bytes_timeout < 10s) {
set bereq.http.quick = "please";
}
......
......@@ -360,17 +360,10 @@ sp_variables = [
('bereq.uncacheable',
'BOOL',
( 'backend', ),
( 'backend_fetch', ), """
Indicates whether the object requested from the backend is
going to be uncacheable - either because the request was an
explicit pass from the client side or a hit on an uncacheable
("hit for pass") object.
Setting this variable in vcl_backend_fetch makes the object
uncacheable.
Clearing the variable has no effect and will log the warning
"Ignoring attempt to reset bereq.uncacheable".
( ), """
Indicates whether this request is uncacheable due
to a pass in the client side or a hit on an existing
uncacheable object (aka hit-for-pass).
"""
),
('bereq.connect_timeout',
......@@ -612,9 +605,9 @@ sp_variables = [
),
('obj.uncacheable',
'BOOL',
( 'hit', ),
( 'deliver', ),
( ), """
Whether the object is uncacheable (aka hit-for-pass)
Whether the object is uncacheable (pass or hit-for-pass).
"""
),
('resp',
......
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