[master] 40ec4a6 The chunk-counter is http/1 specific

Poul-Henning Kamp phk at FreeBSD.org
Mon Jul 14 15:24:54 CEST 2014


commit 40ec4a6b267450cea951e4edbeedc172f0b526e8
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Jul 14 13:24:37 2014 +0000

    The chunk-counter is http/1 specific

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index 586181e..7579b35 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -582,6 +582,7 @@ struct req {
 	struct {
 		ssize_t			bytes_done;
 		ssize_t			bytes_yet;
+		intptr_t		chunk_ctr;
 	}				h1;	/* HTTP1 specific */
 
 	/* The busy objhead we sleep on */
@@ -599,7 +600,6 @@ struct req {
 
 	unsigned char		wantbody;
 	uint64_t		req_bodybytes;	/* Parsed req bodybytes */
-	intptr_t		chunk_ctr;	/* Parsed req bodybytes */
 
 	uint64_t		resp_hdrbytes;	/* Scheduled resp hdrbytes */
 	uint64_t		resp_bodybytes; /* Scheduled resp bodybytes */
diff --git a/bin/varnishd/cache/cache_http1_fsm.c b/bin/varnishd/cache/cache_http1_fsm.c
index 8475511..30f212a 100644
--- a/bin/varnishd/cache/cache_http1_fsm.c
+++ b/bin/varnishd/cache/cache_http1_fsm.c
@@ -286,7 +286,7 @@ http1_req_body_status(struct req *req)
 		return (REQ_BODY_PRESENT);
 	}
 	if (http_HdrIs(req->http, H_Transfer_Encoding, "chunked")) {
-		req->chunk_ctr = -1;
+		req->h1.chunk_ctr = -1;
 		return (REQ_BODY_CHUNKED);
 	}
 	if (http_GetHdr(req->http, H_Transfer_Encoding, NULL))
@@ -511,7 +511,7 @@ http1_iter_req_body(struct req *req, enum req_body_state_e bs,
 		req->acct.req_bodybytes += len;
 		return (len);
 	} else if (bs == REQ_BODY_CHUNKED) {
-		switch (HTTP1_Chunked(req->htc, &req->chunk_ctr, &err,
+		switch (HTTP1_Chunked(req->htc, &req->h1.chunk_ctr, &err,
 		    &req->acct.req_bodybytes, buf, &len)) {
 		case H1CR_ERROR:
 			VSLb(req->vsl, SLT_Debug, "CHUNKERR: %s", err);



More information about the varnish-commit mailing list