[master] 49e7b9c Be consistent about bo-> vs bo.

Poul-Henning Kamp phk at FreeBSD.org
Mon Sep 8 11:27:12 CEST 2014


commit 49e7b9cfec83f3527add01447676b0d1ad112eb7
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Sep 8 09:26:56 2014 +0000

    Be consistent about bo-> vs bo.

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index 1bf2918..89d019f 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -509,7 +509,7 @@ struct busyobj {
 	struct objcore		*ims_oc;
 	struct objcore		*fetch_objcore;
 
-	struct http_conn	htc;
+	struct http_conn	htc[1];
 
 	struct pool_task	fetch_task;
 
diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 24ba95d..ab71e87 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -316,9 +316,9 @@ vbf_stp_startfetch(struct worker *wrk, struct busyobj *bo)
 	 * headers are adultered by VCL
 	 * NB: Also sets other wrk variables
 	 */
-	bo->htc.body_status = RFC2616_Body(bo, &wrk->stats);
+	bo->htc->body_status = RFC2616_Body(bo, &wrk->stats);
 
-	if (bo->htc.body_status == BS_ERROR) {
+	if (bo->htc->body_status == BS_ERROR) {
 		AN (bo->vbc);
 		VDI_CloseFd(&bo->vbc, &bo->acct);
 		VSLb(bo->vsl, SLT_Error, "Body cannot be fetched");
@@ -526,7 +526,7 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
 		AN(bo->uncacheable);
 
 	/* No reason to try streaming a non-existing body */
-	if (bo->htc.body_status == BS_NONE)
+	if (bo->htc->body_status == BS_NONE)
 		bo->do_stream = 0;
 
 	if (VFP_Open(bo->vfc)) {
@@ -555,8 +555,8 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
 	    http_GetHdr(bo->beresp, H_ETag, &p)))
 		ObjSetFlag(bo->vfc, OF_IMSCAND, 1);
 
-	if (bo->htc.body_status != BS_NONE)
-		V1F_Setup_Fetch(bo->vfc, bo->content_length, &bo->htc);
+	if (bo->htc->body_status != BS_NONE)
+		V1F_Setup_Fetch(bo->vfc, bo->content_length, bo->htc);
 
 	/*
 	 * Ready to fetch the body
@@ -574,11 +574,11 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
 	}
 
 	VSLb(bo->vsl, SLT_Fetch_Body, "%u %s %s",
-	    bo->htc.body_status, body_status_2str(bo->htc.body_status),
+	    bo->htc->body_status, body_status_2str(bo->htc->body_status),
 	    bo->do_stream ? "stream" : "-");
 
-	if (bo->htc.body_status != BS_NONE) {
-		assert(bo->htc.body_status != BS_ERROR);
+	if (bo->htc->body_status != BS_NONE) {
+		assert(bo->htc->body_status != BS_ERROR);
 		vbf_fetch_body_helper(bo);
 		bo->acct.beresp_bodybytes = bo->vfc->bodybytes;
 	}
diff --git a/bin/varnishd/cache/cache_http1_fetch.c b/bin/varnishd/cache/cache_http1_fetch.c
index b6657d5..4ab5d47 100644
--- a/bin/varnishd/cache/cache_http1_fetch.c
+++ b/bin/varnishd/cache/cache_http1_fetch.c
@@ -254,7 +254,7 @@ V1F_fetch_hdr(struct worker *wrk, struct busyobj *bo, struct req *req)
 	CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
 	CHECK_OBJ_ORNULL(req, REQ_MAGIC);
 	CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
-	htc = &bo->htc;
+	htc = bo->htc;
 
 	if (bo->director == NULL) {
 		VSLb(bo->vsl, SLT_FetchError, "No backend");
@@ -335,7 +335,7 @@ V1F_fetch_hdr(struct worker *wrk, struct busyobj *bo, struct req *req)
 	    cache_param->http_resp_size,
 	    cache_param->http_resp_hdr_len);
 	CHECK_OBJ_NOTNULL(htc, HTTP_CONN_MAGIC);
-	CHECK_OBJ_NOTNULL(&bo->htc, HTTP_CONN_MAGIC);
+	CHECK_OBJ_NOTNULL(bo->htc, HTTP_CONN_MAGIC);
 
 	VTCP_set_read_timeout(vc->fd, vc->first_byte_timeout);
 
diff --git a/bin/varnishd/cache/cache_panic.c b/bin/varnishd/cache/cache_panic.c
index 9d0330f..7574638 100644
--- a/bin/varnishd/cache/cache_panic.c
+++ b/bin/varnishd/cache/cache_panic.c
@@ -327,7 +327,7 @@ pan_busyobj(const struct busyobj *bo)
 #undef BO_FLAG
 
 	VSB_printf(pan_vsp, "    bodystatus = %d (%s),\n",
-	    bo->htc.body_status, body_status_2str(bo->htc.body_status));
+	    bo->htc->body_status, body_status_2str(bo->htc->body_status));
 	if (!VTAILQ_EMPTY(&bo->vfc->vfp)) {
 		VSB_printf(pan_vsp, "    filters =");
 		VTAILQ_FOREACH(vfe, &bo->vfc->vfp, list)



More information about the varnish-commit mailing list