[experimental-ims] c766bc8 Merge master -> experimental-ims
Geoff Simmons
geoff at varnish-cache.org
Tue Jan 24 18:30:29 CET 2012
commit c766bc8d3b4ed95aeee184d6a220776c4626cb3b
Merge: 3cf4dfd 4a75131
Author: Geoff Simmons <geoff at uplex.de>
Date: Tue Jan 24 18:28:39 2012 +0100
Merge master -> experimental-ims
diff --cc bin/varnishd/cache/cache_center.c
index c16c42e,ea176cb..398996d
--- a/bin/varnishd/cache/cache_center.c
+++ b/bin/varnishd/cache/cache_center.c
@@@ -826,12 -806,12 +824,16 @@@ cnt_fetchbody(struct sess *sp, struct w
if (!req->wantbody)
wrk->busyobj->do_stream = 0;
+ /* No reason to try streaming a non-existing body */
+ if (wrk->busyobj->body_status == BS_NONE)
+ wrk->busyobj->do_stream = 0;
+
l = http_EstimateWS(wrk->busyobj->beresp,
pass ? HTTPH_R_PASS : HTTPH_A_INS, &nhttp);
+ if (sp->stale_obj) {
+ l += http_EstimateWS(sp->stale_obj->http, 0, &stale_nhttp);
+ nhttp += stale_nhttp;
+ }
/* Create Vary instructions */
if (req->objcore != NULL) {
@@@ -1262,9 -1219,7 +1264,9 @@@ cnt_lookup(struct sess *sp, struct work
wrk->stats.cache_hitpass++;
WSP(sp, SLT_HitPass, "%u", req->obj->xid);
(void)HSH_Deref(wrk, NULL, &req->obj);
+ if (sp->stale_obj != NULL)
+ (void)HSH_Deref(wrk, NULL, &sp->stale_obj);
- req->objcore = NULL;
+ AZ(req->objcore);
sp->step = STP_PASS;
return (0);
}
@@@ -1325,41 -1280,32 +1327,38 @@@ cnt_miss(struct sess *sp, struct worke
http_SetHeader(wrk, sp->vsl_id, wrk->busyobj->bereq,
"Accept-Encoding: gzip");
}
- wrk->connect_timeout = 0;
- wrk->first_byte_timeout = 0;
- wrk->between_bytes_timeout = 0;
+ /* If a candidate for a conditional backend request was found,
+ * add If-Modified-Since and/or If-None-Match to the bereq.
+ */
+ if (sp->stale_obj)
+ http_CheckRefresh(sp);
+
VCL_miss_method(sp);
+ if (req->handling == VCL_RET_FETCH) {
+ CHECK_OBJ_NOTNULL(wrk->busyobj, BUSYOBJ_MAGIC);
+ sp->step = STP_FETCH;
+ return (0);
+ }
+
+ AZ(HSH_Deref(wrk, req->objcore, NULL));
+ req->objcore = NULL;
+ http_Setup(wrk->busyobj->bereq, NULL);
+ VBO_DerefBusyObj(wrk, &wrk->busyobj);
+
switch(req->handling) {
case VCL_RET_ERROR:
- AZ(HSH_Deref(wrk, req->objcore, NULL));
- req->objcore = NULL;
- http_Setup(wrk->busyobj->bereq, NULL);
- VBO_DerefBusyObj(wrk, &wrk->busyobj);
sp->step = STP_ERROR;
- return (0);
+ break;
case VCL_RET_PASS:
- AZ(HSH_Deref(wrk, req->objcore, NULL));
- req->objcore = NULL;
- VBO_DerefBusyObj(wrk, &wrk->busyobj);
sp->step = STP_PASS;
- return (0);
- case VCL_RET_FETCH:
- CHECK_OBJ_NOTNULL(wrk->busyobj, BUSYOBJ_MAGIC);
- sp->step = STP_FETCH;
- return (0);
+ break;
case VCL_RET_RESTART:
- AZ(HSH_Deref(wrk, req->objcore, NULL));
- req->objcore = NULL;
- VBO_DerefBusyObj(wrk, &wrk->busyobj);
- INCOMPL();
+ req->restarts++;
+ req->director = NULL;
+ sp->step = STP_RECV;
+ break;
default:
WRONG("Illegal action in vcl_miss{}");
}
More information about the varnish-commit
mailing list