[master] 1bad900 Eliminate the VDI->getbody() method, I can't imagine anything it will ever be useful for.
Poul-Henning Kamp
phk at FreeBSD.org
Wed May 2 11:14:07 UTC 2018
commit 1bad900ae2ffc78bc40436070ed207b1044b57e7
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Wed May 2 08:59:45 2018 +0000
Eliminate the VDI->getbody() method, I can't imagine anything
it will ever be useful for.
diff --git a/bin/varnishd/cache/cache_director.c b/bin/varnishd/cache/cache_director.c
index feff1b7..f88a33b 100644
--- a/bin/varnishd/cache/cache_director.c
+++ b/bin/varnishd/cache/cache_director.c
@@ -129,29 +129,6 @@ VDI_GetHdr(struct busyobj *bo)
return (i);
}
-/* Setup body fetch --------------------------------------------------*/
-
-int
-VDI_GetBody(struct busyobj *bo)
-{
- const struct director *d;
- struct vrt_ctx ctx[1];
-
- CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
- INIT_OBJ(ctx, VRT_CTX_MAGIC);
- VCL_Bo2Ctx(ctx, bo);
-
- d = bo->director_resp;
- CHECK_OBJ_NOTNULL(d, DIRECTOR_MAGIC);
- AZ(d->vdir->methods->resolve);
-
- assert(bo->director_state == DIR_S_HDRS);
- bo->director_state = DIR_S_BODY;
- if (d->vdir->methods->getbody == NULL)
- return (0);
- return (d->vdir->methods->getbody(ctx, d));
-}
-
/* Get IP number (if any ) -------------------------------------------*/
VCL_IP
diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index a402fce..06d9ad9 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -646,16 +646,6 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
http_GetHdr(bo->beresp, H_ETag, &p)))
ObjSetFlag(bo->wrk, bo->fetch_objcore, OF_IMSCAND, 1);
- if (bo->htc->body_status != BS_NONE &&
- VDI_GetBody(bo) != 0) {
- (void)VFP_Error(bo->vfc,
- "GetBody failed - workspace_backend overflow?");
- VFP_Close(bo->vfc);
- bo->htc->doclose = SC_OVERLOAD;
- VDI_Finish(bo);
- return (F_STP_ERROR);
- }
-
assert(bo->fetch_objcore->boc->refcount >= 1);
assert(bo->fetch_objcore->boc->state == BOS_REQ_DONE);
diff --git a/bin/varnishd/cache/cache_varnishd.h b/bin/varnishd/cache/cache_varnishd.h
index 90b9631..d2f35e3 100644
--- a/bin/varnishd/cache/cache_varnishd.h
+++ b/bin/varnishd/cache/cache_varnishd.h
@@ -117,7 +117,6 @@ void VBO_ReleaseBusyObj(struct worker *wrk, struct busyobj **busyobj);
/* cache_director.c */
int VDI_GetHdr(struct busyobj *);
-int VDI_GetBody(struct busyobj *);
VCL_IP VDI_GetIP(struct busyobj *);
void VDI_Finish(struct busyobj *bo);
enum sess_close VDI_Http1Pipe(struct req *, struct busyobj *);
diff --git a/include/vrt.h b/include/vrt.h
index d23ee9e..a0c142c 100644
--- a/include/vrt.h
+++ b/include/vrt.h
@@ -420,7 +420,6 @@ void VRT_VSM_Cluster_Destroy(VRT_CTX, struct vsmw_cluster **);
typedef VCL_BOOL vdi_healthy_f(VRT_CTX, VCL_BACKEND, VCL_TIME *);
typedef VCL_BACKEND vdi_resolve_f(VRT_CTX, VCL_BACKEND);
typedef int vdi_gethdrs_f(VRT_CTX, VCL_BACKEND);
-typedef int vdi_getbody_f(VRT_CTX, VCL_BACKEND);
typedef VCL_IP vdi_getip_f(VRT_CTX, VCL_BACKEND);
typedef void vdi_finish_f(VRT_CTX, VCL_BACKEND);
typedef enum sess_close vdi_http1pipe_f(VRT_CTX, VCL_BACKEND);
@@ -437,7 +436,6 @@ struct vdi_methods {
vdi_healthy_f *healthy;
vdi_resolve_f *resolve;
vdi_gethdrs_f *gethdrs;
- vdi_getbody_f *getbody;
vdi_getip_f *getip;
vdi_finish_f *finish;
vdi_event_f *event;
More information about the varnish-commit
mailing list