[master] e9af8be89 Add documenting asserts

Poul-Henning Kamp phk at FreeBSD.org
Wed Feb 19 14:16:06 UTC 2020


commit e9af8be89906411acb0c48a89295222e65937ba0
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Feb 19 14:15:04 2020 +0000

    Add documenting asserts

diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 9f94a546d..4253e21bf 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -250,6 +250,9 @@ vbf_stp_mkbereq(struct worker *wrk, struct busyobj *bo)
 		HSH_Ref(bo->bereq_body);
 		bo->req = NULL;
 		ObjSetState(bo->wrk, bo->fetch_objcore, BOS_REQ_DONE);
+	} else if (bo->req->req_body_status != REQ_BODY_WITH_LEN &&
+	    bo->req->req_body_status != REQ_BODY_WITHOUT_LEN) {
+		WRONG("Bad req_body_status");
 	}
 	return (F_STP_STARTFETCH);
 }
diff --git a/bin/varnishd/http1/cache_http1_fetch.c b/bin/varnishd/http1/cache_http1_fetch.c
index ee7a9fec1..79b6ceb35 100644
--- a/bin/varnishd/http1/cache_http1_fetch.c
+++ b/bin/varnishd/http1/cache_http1_fetch.c
@@ -107,6 +107,7 @@ V1F_SendReq(struct worker *wrk, struct busyobj *bo, uint64_t *ctr_hdrbytes,
 	i = 0;
 
 	if (bo->bereq_body != NULL) {
+		AZ(bo->req);
 		if (do_chunked)
 			V1L_Chunked(wrk);
 		(void)ObjIterate(bo->wrk, bo->bereq_body,


More information about the varnish-commit mailing list