[master] cbc7cec Setup the VFP already when we have fetched the headers.

Poul-Henning Kamp phk at FreeBSD.org
Wed Sep 20 19:01:04 UTC 2017


commit cbc7cec63fd0d609f1040b49f2f1f704606bb773
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Sep 20 14:00:42 2017 +0000

    Setup the VFP already when we have fetched the headers.

diff --git a/bin/varnishd/cache/cache_backend.c b/bin/varnishd/cache/cache_backend.c
index 4e75b2f..b9d6829 100644
--- a/bin/varnishd/cache/cache_backend.c
+++ b/bin/varnishd/cache/cache_backend.c
@@ -242,20 +242,6 @@ vbe_dir_gethdrs(const struct director *d, struct worker *wrk,
 	return (-1);
 }
 
-static int __match_proto__(vdi_getbody_f)
-vbe_dir_getbody(const struct director *d, struct worker *wrk,
-    struct busyobj *bo)
-{
-
-	CHECK_OBJ_NOTNULL(d, DIRECTOR_MAGIC);
-	CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
-	CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
-	CHECK_OBJ_NOTNULL(bo->vfc, VFP_CTX_MAGIC);
-	CHECK_OBJ_NOTNULL(bo->htc, HTTP_CONN_MAGIC);
-
-	return (V1F_Setup_Fetch(bo->vfc, bo->htc));
-}
-
 static const struct suckaddr * __match_proto__(vdi_getip_f)
 vbe_dir_getip(const struct director *d, struct worker *wrk,
     struct busyobj *bo)
@@ -355,7 +341,6 @@ VBE_fill_director(struct backend *be)
 	d->http1pipe = vbe_dir_http1pipe;
 	d->healthy = vbe_dir_healthy;
 	d->gethdrs = vbe_dir_gethdrs;
-	d->getbody = vbe_dir_getbody;
 	d->getip = vbe_dir_getip;
 	d->finish = vbe_dir_finish;
 	d->panic = vbe_panic;
diff --git a/bin/varnishd/http1/cache_http1_fetch.c b/bin/varnishd/http1/cache_http1_fetch.c
index 87a3194..3e230cb 100644
--- a/bin/varnishd/http1/cache_http1_fetch.c
+++ b/bin/varnishd/http1/cache_http1_fetch.c
@@ -203,5 +203,10 @@ V1F_FetchRespHdr(struct busyobj *bo)
 	htc->doclose = http_DoConnection(hp);
 	RFC2616_Response_Body(bo->wrk, bo);
 
+	bo->vfc->http = bo->beresp;
+	if (bo->htc->body_status != BS_NONE &&
+	    bo->htc->body_status != BS_ERROR)
+		(void)V1F_Setup_Fetch(bo->vfc, bo->htc);
+
 	return (0);
 }


More information about the varnish-commit mailing list