[master] 735523e Fail if backend workspace doesn't have room for htc

Poul-Henning Kamp phk at FreeBSD.org
Wed May 13 10:16:20 CEST 2015


commit 735523ef6f84b24e265570d633def0ae16ae10e8
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon May 11 10:27:08 2015 +0000

    Fail if backend workspace doesn't have room for htc

diff --git a/bin/varnishd/cache/cache_backend.c b/bin/varnishd/cache/cache_backend.c
index c555e05..32189df 100644
--- a/bin/varnishd/cache/cache_backend.c
+++ b/bin/varnishd/cache/cache_backend.c
@@ -129,9 +129,11 @@ vbe_dir_getfd(const struct director *d, struct busyobj *bo)
 	    vc->fd, bp->display_name, abuf2, pbuf2, abuf1, pbuf1);
 
 	vc->backend->vsc->req++;
+	AZ(bo->htc);
+	bo->htc = WS_Alloc(bo->ws, sizeof *bo->htc);
 	if (bo->htc == NULL)
-		bo->htc = WS_Alloc(bo->ws, sizeof *bo->htc);
-	AN(bo->htc);
+		/* XXX: counter ? */
+		return (-1);
 	INIT_OBJ(bo->htc, HTTP_CONN_MAGIC);
 	bo->htc->vbc = vc;
 	bo->htc->fd = vc->fd;



More information about the varnish-commit mailing list