[master] 7221cf7 Rename REQ_BODY_ modes to WITH[OUT]_LEN rather than transmission mode.

Poul-Henning Kamp phk at FreeBSD.org
Wed Sep 10 09:48:52 CEST 2014


commit 7221cf79675933c89c5db87e85c54d180126211e
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Wed Sep 10 07:48:01 2014 +0000

    Rename REQ_BODY_ modes to WITH[OUT]_LEN rather than transmission mode.

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index f514180..8080082 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -1111,7 +1111,7 @@ void SES_Delete(struct sess *sp, enum sess_close reason, double now);
 struct sesspool *SES_NewPool(struct pool *pp, unsigned pool_no);
 void SES_DeletePool(struct sesspool *sp);
 int SES_ScheduleReq(struct req *);
-struct req *SES_GetReq(struct worker *, struct sess *);
+struct req *SES_GetReq(const struct worker *, struct sess *);
 void SES_Handle(struct sess *sp, double now);
 void SES_ReleaseReq(struct req *);
 pool_func_t SES_pool_accept_task;
diff --git a/bin/varnishd/cache/cache_http1_fetch.c b/bin/varnishd/cache/cache_http1_fetch.c
index 3ad3eee..7043ac5 100644
--- a/bin/varnishd/cache/cache_http1_fetch.c
+++ b/bin/varnishd/cache/cache_http1_fetch.c
@@ -139,7 +139,7 @@ V1F_fetch_hdr(struct worker *wrk, struct busyobj *bo, struct req *req)
 	if (!http_GetHdr(bo->bereq, H_Host, NULL))
 		VDI_AddHostHeader(bo->bereq, vc);
 
-	if (req != NULL && req->req_body_status == REQ_BODY_CHUNKED) {
+	if (req != NULL && req->req_body_status == REQ_BODY_WITHOUT_LEN) {
 		http_PrintfHeader(hp, "Transfer-Encoding: chunked");
 		do_chunked = 1;
 	}
diff --git a/bin/varnishd/cache/cache_http1_fsm.c b/bin/varnishd/cache/cache_http1_fsm.c
index bd80c79..ca6794b 100644
--- a/bin/varnishd/cache/cache_http1_fsm.c
+++ b/bin/varnishd/cache/cache_http1_fsm.c
@@ -298,13 +298,13 @@ http1_dissect(struct worker *wrk, struct req *req)
 	assert (req->req_body_status == REQ_BODY_INIT);
 
 	if (req->htc->body_status == BS_CHUNKED) {
-		req->req_body_status = REQ_BODY_CHUNKED;
+		req->req_body_status = REQ_BODY_WITHOUT_LEN;
 	} else if (req->htc->body_status == BS_LENGTH) {
-		req->req_body_status = REQ_BODY_PRESENT;
+		req->req_body_status = REQ_BODY_WITH_LEN;
 	} else if (req->htc->body_status == BS_NONE) {
 		req->req_body_status = REQ_BODY_NONE;
 	} else if (req->htc->body_status == BS_EOF) {
-		req->req_body_status = REQ_BODY_CHUNKED;
+		req->req_body_status = REQ_BODY_WITHOUT_LEN;
 	} else {
 		WRONG("Unknown req.body_length situation");
 	}
@@ -462,8 +462,8 @@ HTTP1_IterateReqBody(struct req *req, req_body_iter_f *func, void *priv)
 		return (0);
 	case REQ_BODY_NONE:
 		return (0);
-	case REQ_BODY_PRESENT:
-	case REQ_BODY_CHUNKED:
+	case REQ_BODY_WITH_LEN:
+	case REQ_BODY_WITHOUT_LEN:
 		break;
 	case REQ_BODY_TAKEN:
 		VSLb(req->vsl, SLT_VCL_Error,
@@ -477,8 +477,8 @@ HTTP1_IterateReqBody(struct req *req, req_body_iter_f *func, void *priv)
 		WRONG("Wrong req_body_status in HTTP1_IterateReqBody()");
 	}
 	Lck_Lock(&req->sp->mtx);
-	if (req->req_body_status == REQ_BODY_PRESENT ||
-	    req->req_body_status == REQ_BODY_CHUNKED) {
+	if (req->req_body_status == REQ_BODY_WITH_LEN ||
+	    req->req_body_status == REQ_BODY_WITHOUT_LEN) {
 		req->req_body_status = REQ_BODY_TAKEN;
 		i = 0;
 	} else
@@ -545,8 +545,8 @@ int
 HTTP1_DiscardReqBody(struct req *req)
 {
 
-	if (req->req_body_status == REQ_BODY_PRESENT ||
-	    req->req_body_status == REQ_BODY_CHUNKED)
+	if (req->req_body_status == REQ_BODY_WITH_LEN ||
+	    req->req_body_status == REQ_BODY_WITHOUT_LEN)
 		(void)HTTP1_IterateReqBody(req, httpq_req_body_discard, NULL);
 	return(0);
 }
@@ -575,8 +575,8 @@ HTTP1_CacheReqBody(struct req *req, ssize_t maxsize)
 		return (-1);
 	case REQ_BODY_NONE:
 		return (0);
-	case REQ_BODY_CHUNKED:
-	case REQ_BODY_PRESENT:
+	case REQ_BODY_WITHOUT_LEN:
+	case REQ_BODY_WITH_LEN:
 		break;
 	default:
 		WRONG("Wrong req_body_status in HTTP1_CacheReqBody()");
diff --git a/bin/varnishd/cache/cache_session.c b/bin/varnishd/cache/cache_session.c
index bd48b45..b6d8049 100644
--- a/bin/varnishd/cache/cache_session.c
+++ b/bin/varnishd/cache/cache_session.c
@@ -315,7 +315,7 @@ SES_Delete(struct sess *sp, enum sess_close reason, double now)
  */
 
 struct req *
-SES_GetReq(struct worker *wrk, struct sess *sp)
+SES_GetReq(const struct worker *wrk, struct sess *sp)
 {
 	struct sesspool *pp;
 	struct req *req;
diff --git a/bin/varnishtest/tests/r01581.vtc b/bin/varnishtest/tests/r01581.vtc
index f04eb0e..9ba44b1 100644
--- a/bin/varnishtest/tests/r01581.vtc
+++ b/bin/varnishtest/tests/r01581.vtc
@@ -11,7 +11,7 @@ varnish v1 -vcl+backend {
 logexpect l1 -v v1 -g request {
 	  expect 0 1001 Begin
 	  expect * =	ReqStart
-	  expect * = 	End
+	  expect * =	End
 } -start
 
 client c1 {
diff --git a/include/tbl/req_body.h b/include/tbl/req_body.h
index 9e58deb..d28ada4 100644
--- a/include/tbl/req_body.h
+++ b/include/tbl/req_body.h
@@ -30,8 +30,8 @@
 /*lint -save -e525 -e539 */
 
 REQ_BODY(INIT)
-REQ_BODY(PRESENT)
-REQ_BODY(CHUNKED)
+REQ_BODY(WITHOUT_LEN)
+REQ_BODY(WITH_LEN)
 REQ_BODY(TAKEN)
 REQ_BODY(CACHED)
 REQ_BODY(FAIL)



More information about the varnish-commit mailing list