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