[master] 034abbfd6 Rename REQ_BODY_FAIL to REQ_BODY_ERROR in preparation for merge with BS_*

Poul-Henning Kamp phk at FreeBSD.org
Fri Feb 21 08:34:06 UTC 2020


commit 034abbfd6e314e10b51386f2605bbd5a4c087403
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Fri Feb 21 07:14:18 2020 +0000

    Rename REQ_BODY_FAIL to REQ_BODY_ERROR in preparation for merge with BS_*

diff --git a/bin/varnishd/cache/cache_req_body.c b/bin/varnishd/cache/cache_req_body.c
index 2987a2bb2..4e12d8e06 100644
--- a/bin/varnishd/cache/cache_req_body.c
+++ b/bin/varnishd/cache/cache_req_body.c
@@ -77,7 +77,7 @@ vrb_pull(struct req *req, ssize_t maxsize, objiterate_f *func, void *priv)
 	req->storage = NULL;
 
 	if (STV_NewObject(req->wrk, req->body_oc, stv, 8) == 0) {
-		req->req_body_status = REQ_BODY_FAIL;
+		req->req_body_status = REQ_BODY_ERROR;
 		HSH_DerefBoc(req->wrk, req->body_oc);
 		AZ(HSH_DerefObjCore(req->wrk, &req->body_oc, 0));
 		(void)VFP_Error(vfc, "Object allocation failed:"
@@ -88,7 +88,7 @@ vrb_pull(struct req *req, ssize_t maxsize, objiterate_f *func, void *priv)
 	vfc->oc = req->body_oc;
 
 	if (VFP_Open(vfc) < 0) {
-		req->req_body_status = REQ_BODY_FAIL;
+		req->req_body_status = REQ_BODY_ERROR;
 		HSH_DerefBoc(req->wrk, req->body_oc);
 		AZ(HSH_DerefObjCore(req->wrk, &req->body_oc, 0));
 		return (-1);
@@ -136,7 +136,7 @@ vrb_pull(struct req *req, ssize_t maxsize, objiterate_f *func, void *priv)
 		HSH_DerefBoc(req->wrk, req->body_oc);
 		AZ(HSH_DerefObjCore(req->wrk, &req->body_oc, 0));
 		if (vfps != VFP_END) {
-			req->req_body_status = REQ_BODY_FAIL;
+			req->req_body_status = REQ_BODY_ERROR;
 			if (r == 0)
 				r = -1;
 		}
@@ -148,7 +148,7 @@ vrb_pull(struct req *req, ssize_t maxsize, objiterate_f *func, void *priv)
 	HSH_DerefBoc(req->wrk, req->body_oc);
 
 	if (vfps != VFP_END) {
-		req->req_body_status = REQ_BODY_FAIL;
+		req->req_body_status = REQ_BODY_ERROR;
 		AZ(HSH_DerefObjCore(req->wrk, &req->body_oc, 0));
 		return (-1);
 	}
@@ -204,7 +204,7 @@ VRB_Iterate(struct worker *wrk, struct vsl_log *vsl,
 		VSLb(vsl, SLT_VCL_Error,
 		    "Uncached req.body can only be consumed once.");
 		return (-1);
-	case REQ_BODY_FAIL:
+	case REQ_BODY_ERROR:
 		VSLb(vsl, SLT_FetchError,
 		    "Had failed reading req.body before.");
 		return (-1);
@@ -307,7 +307,7 @@ VRB_Cache(struct req *req, ssize_t maxsize)
 	case REQ_BODY_CACHED:
 		AZ(ObjGetU64(req->wrk, req->body_oc, OA_LEN, &u));
 		return (u);
-	case REQ_BODY_FAIL:
+	case REQ_BODY_ERROR:
 		return (-1);
 	case REQ_BODY_NONE:
 		return (0);
@@ -319,7 +319,7 @@ VRB_Cache(struct req *req, ssize_t maxsize)
 	}
 
 	if (req->htc->content_length > maxsize) {
-		req->req_body_status = REQ_BODY_FAIL;
+		req->req_body_status = REQ_BODY_ERROR;
 		(void)VFP_Error(req->vfc, "Request body too big to cache");
 		return (-1);
 	}
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index a7dbb42e3..1deb2595c 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -877,7 +877,7 @@ cnt_recv(struct worker *wrk, struct req *req)
 
 	cnt_recv_prep(req, ci);
 
-	if (req->req_body_status == REQ_BODY_FAIL) {
+	if (req->req_body_status == REQ_BODY_ERROR) {
 		req->doclose = SC_OVERLOAD;
 		return (REQ_FSM_DONE);
 	}
@@ -899,7 +899,7 @@ cnt_recv(struct worker *wrk, struct req *req)
 	}
 
 	/* Attempts to cache req.body may fail */
-	if (req->req_body_status == REQ_BODY_FAIL) {
+	if (req->req_body_status == REQ_BODY_ERROR) {
 		req->doclose = SC_RX_BODY;
 		return (REQ_FSM_DONE);
 	}
diff --git a/bin/varnishd/http1/cache_http1_fetch.c b/bin/varnishd/http1/cache_http1_fetch.c
index 4c5b593a1..4cecb3148 100644
--- a/bin/varnishd/http1/cache_http1_fetch.c
+++ b/bin/varnishd/http1/cache_http1_fetch.c
@@ -120,7 +120,7 @@ V1F_SendReq(struct worker *wrk, struct busyobj *bo, uint64_t *ctr_hdrbytes,
 		if (bo->req->req_body_status != REQ_BODY_CACHED)
 			bo->no_retry = "req.body not cached";
 
-		if (bo->req->req_body_status == REQ_BODY_FAIL) {
+		if (bo->req->req_body_status == REQ_BODY_ERROR) {
 			/*
 			 * XXX: (#2332) We should test to see if the backend
 			 * XXX: sent us some headers explaining why.
diff --git a/bin/varnishd/http1/cache_http1_fsm.c b/bin/varnishd/http1/cache_http1_fsm.c
index bbce1b4fe..73ea12ce0 100644
--- a/bin/varnishd/http1/cache_http1_fsm.c
+++ b/bin/varnishd/http1/cache_http1_fsm.c
@@ -153,7 +153,7 @@ http1_req_body(struct req *req)
 	CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
 	if (req->htc->body_status->avail &&
 	    V1F_Setup_Fetch(req->vfc, req->htc) != 0)
-		req->req_body_status = REQ_BODY_FAIL;
+		req->req_body_status = REQ_BODY_ERROR;
 }
 
 static void
diff --git a/include/tbl/req_body.h b/include/tbl/req_body.h
index 9effc0707..93c46c0bc 100644
--- a/include/tbl/req_body.h
+++ b/include/tbl/req_body.h
@@ -37,7 +37,7 @@ REQ_BODY(WITH_LEN)
 /* states >= TAKEN imply that no body is to be read */
 REQ_BODY(TAKEN)
 REQ_BODY(CACHED)
-REQ_BODY(FAIL)
+REQ_BODY(ERROR)
 REQ_BODY(NONE)
 #undef REQ_BODY
 


More information about the varnish-commit mailing list