[3.0] 0d1be0b Be much more bombastic about the per-request flags.
Tollef Fog Heen
tfheen at varnish-cache.org
Mon Aug 29 10:45:41 CEST 2011
commit 0d1be0bb5412dd7e0723ab31dc6773febc60ebf8
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Wed Aug 24 13:48:55 2011 +0000
Be much more bombastic about the per-request flags.
This highlights that they really need to go into a struct or
bitmap for clarity, but I'm not doing that right before 3.0.1
Fixes #986
Many Thanks To: Kristian
diff --git a/bin/varnishd/cache_center.c b/bin/varnishd/cache_center.c
index c1d3651..9c7f822 100644
--- a/bin/varnishd/cache_center.c
+++ b/bin/varnishd/cache_center.c
@@ -310,6 +310,13 @@ cnt_done(struct sess *sp)
sp->director = NULL;
sp->restarts = 0;
+ sp->wrk->do_esi = 0;
+ sp->wrk->do_gunzip = 0;
+ sp->wrk->do_gzip = 0;
+ sp->wrk->do_stream = 0;
+ sp->wrk->is_gunzip = 0;
+ sp->wrk->is_gzip = 0;
+
if (sp->vcl != NULL && sp->esi_level == 0) {
if (sp->wrk->vcl != NULL)
VCL_Rel(&sp->wrk->vcl);
@@ -417,6 +424,13 @@ cnt_error(struct sess *sp)
CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
+ sp->wrk->do_esi = 0;
+ sp->wrk->is_gzip = 0;
+ sp->wrk->is_gunzip = 0;
+ sp->wrk->do_gzip = 0;
+ sp->wrk->do_gunzip = 0;
+ sp->wrk->do_stream = 0;
+
w = sp->wrk;
if (sp->obj == NULL) {
HSH_Prealloc(sp);
@@ -572,7 +586,7 @@ cnt_fetch(struct sess *sp)
if (sp->objcore == NULL)
sp->wrk->exp.ttl = -1.;
- sp->wrk->do_esi = 0;
+ AZ(sp->wrk->do_esi);
VCL_fetch_method(sp);
@@ -988,6 +1002,8 @@ cnt_hit(struct sess *sp)
assert(!(sp->obj->objcore->flags & OC_F_PASS));
+ AZ(sp->wrk->do_stream);
+
VCL_hit_method(sp);
if (sp->handling == VCL_RET_DELIVER) {
@@ -1360,7 +1376,8 @@ cnt_recv(struct sess *sp)
return (0);
}
- /* XXX: do_esi ? */
+ /* Zap these, in case we came here through restart */
+ sp->wrk->do_esi = 0;
sp->wrk->is_gzip = 0;
sp->wrk->is_gunzip = 0;
sp->wrk->do_gzip = 0;
@@ -1541,6 +1558,13 @@ CNT_Session(struct sess *sp)
sp->step == STP_LOOKUP ||
sp->step == STP_RECV);
+ AZ(w->do_stream);
+ AZ(w->is_gzip);
+ AZ(w->do_gzip);
+ AZ(w->is_gunzip);
+ AZ(w->do_gunzip);
+ AZ(w->do_esi);
+
/*
* Whenever we come in from the acceptor we need to set blocking
* mode, but there is no point in setting it when we come from
@@ -1582,6 +1606,12 @@ CNT_Session(struct sess *sp)
CHECK_OBJ_ORNULL(w->nobjhead, OBJHEAD_MAGIC);
}
WSL_Flush(w, 0);
+ AZ(w->do_stream);
+ AZ(w->is_gzip);
+ AZ(w->do_gzip);
+ AZ(w->is_gunzip);
+ AZ(w->do_gunzip);
+ AZ(w->do_esi);
assert(WRW_IsReleased(w));
}
diff --git a/bin/varnishd/cache_esi_deliver.c b/bin/varnishd/cache_esi_deliver.c
index 85e1b15..61555bf 100644
--- a/bin/varnishd/cache_esi_deliver.c
+++ b/bin/varnishd/cache_esi_deliver.c
@@ -90,6 +90,13 @@ ved_include(struct sess *sp, const char *src, const char *host)
/* Client content already taken care of */
http_Unset(sp->http, H_Content_Length);
+ sp->wrk->do_esi = 0;
+ sp->wrk->is_gzip = 0;
+ sp->wrk->is_gunzip = 0;
+ sp->wrk->do_gzip = 0;
+ sp->wrk->do_gunzip = 0;
+ sp->wrk->do_stream = 0;
+
sxid = sp->xid;
while (1) {
sp->wrk = w;
More information about the varnish-commit
mailing list