[master] 4a1b92b Revert a5ce9982d87a4398b45886f74306a0ed4d6b1829, there is no net benefit from hair-splitting the number of http headers we support. Improve description to bring this point home, in case I ever get that silly idea again.

Poul-Henning Kamp phk at varnish-cache.org
Mon Jan 14 11:51:14 CET 2013


commit 4a1b92bfb275fc4842f5319c4e855572ca25e8fb
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Jan 14 10:50:25 2013 +0000

    Revert a5ce9982d87a4398b45886f74306a0ed4d6b1829, there is no
    net benefit from hair-splitting the number of http headers we
    support.   Improve description to bring this point home, in case
    I ever get that silly idea again.

diff --git a/bin/varnishd/cache/cache_busyobj.c b/bin/varnishd/cache/cache_busyobj.c
index 4bf5ad2..0691b83 100644
--- a/bin/varnishd/cache/cache_busyobj.c
+++ b/bin/varnishd/cache/cache_busyobj.c
@@ -113,7 +113,7 @@ VBO_GetBusyObj(struct worker *wrk, struct req *req)
 	p = (void*)PRNDUP(p);
 	assert(p < bo->end);
 
-	nhttp = (uint16_t)cache_param->http_resp_max_hdr;
+	nhttp = (uint16_t)cache_param->http_max_hdr;
 	sz = HTTP_estimate(nhttp);
 
 	bo->bereq = HTTP_create(p, nhttp);
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index 946d867..547755a 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -274,7 +274,7 @@ cnt_error(struct worker *wrk, struct req *req)
 	req->objcore = HSH_NewObjCore(wrk);
 	req->obj = STV_NewObject(bo, &req->objcore,
 	    TRANSIENT_STORAGE, cache_param->http_resp_size,
-	    (uint16_t)cache_param->http_req_max_hdr);
+	    (uint16_t)cache_param->http_max_hdr);
 	bo->stats = NULL;
 	if (req->obj == NULL) {
 		req->doclose = SC_OVERLOAD;
diff --git a/bin/varnishd/cache/cache_session.c b/bin/varnishd/cache/cache_session.c
index 51d9bc4..2873066 100644
--- a/bin/varnishd/cache/cache_session.c
+++ b/bin/varnishd/cache/cache_session.c
@@ -362,7 +362,7 @@ SES_GetReq(struct worker *wrk, struct sess *sp)
 	p = (void*)PRNDUP(p);
 	assert(p < e);
 
-	nhttp = (uint16_t)cache_param->http_req_max_hdr;
+	nhttp = (uint16_t)cache_param->http_max_hdr;
 	hl = HTTP_estimate(nhttp);
 
 	req->http = HTTP_create(p, nhttp);
diff --git a/bin/varnishd/common/params.h b/bin/varnishd/common/params.h
index 42e169f..a6e881b 100644
--- a/bin/varnishd/common/params.h
+++ b/bin/varnishd/common/params.h
@@ -98,10 +98,9 @@ struct params {
 	unsigned		shm_workspace;
 	unsigned		http_req_size;
 	unsigned		http_req_hdr_len;
-	unsigned		http_req_max_hdr;
 	unsigned		http_resp_size;
 	unsigned		http_resp_hdr_len;
-	unsigned		http_resp_max_hdr;
+	unsigned		http_max_hdr;
 
 	unsigned		shm_reclen;
 
diff --git a/bin/varnishd/mgt/mgt_param_tbl.c b/bin/varnishd/mgt/mgt_param_tbl.c
index e5d709f..8601bae 100644
--- a/bin/varnishd/mgt/mgt_param_tbl.c
+++ b/bin/varnishd/mgt/mgt_param_tbl.c
@@ -86,7 +86,6 @@ const struct parspec mgt_parspec[] = {
 		" just wastes the space.\n",
 		DELAYED_EFFECT,
 		"2048", "bytes" },
-
 	{ "http_req_hdr_len",
 		tweak_bytes_u, &mgt_param.http_req_hdr_len,
 		40, UINT_MAX,
@@ -105,16 +104,6 @@ const struct parspec mgt_parspec[] = {
 		"how much of that the request is allowed to take up.",
 		0,
 		"32k", "bytes" },
-	{ "http_req_max_hdr", tweak_uint, &mgt_param.http_req_max_hdr,
-		32, 65535,
-		"Maximum number of HTTP headers we will deal with in "
-		"client request.  "
-		"Note that the first line occupies five header fields.\n"
-		"This parameter does not influence storage consumption, "
-		"objects allocate exact space for the headers they store.\n",
-		0,
-		"64", "header lines" },
-
 	{ "http_resp_hdr_len",
 		tweak_bytes_u, &mgt_param.http_resp_hdr_len,
 		40, UINT_MAX,
@@ -133,16 +122,14 @@ const struct parspec mgt_parspec[] = {
 		"limits how much of that the request is allowed to take up.",
 		0,
 		"32k", "bytes" },
-	{ "http_resp_max_hdr", tweak_uint, &mgt_param.http_resp_max_hdr,
-		32, 65535,
-		"Maximum number of HTTP headers we will deal with in "
-		"backend response.  "
-		"Note that the first line occupies five header fields.\n"
-		"This parameter does not influence storage consumption, "
-		"objects allocate exact space for the headers they store.\n",
+	{ "http_max_hdr", tweak_uint, &mgt_param.http_max_hdr, 32, 65535,
+		"Maximum number of HTTP header lines we allow in "
+		"{req|resp|bereq|beresp}.http "
+		"(obj.http is autosized to the exact number of headers).\n"
+		"Cheap, ~20 bytes, in terms of workspace memory.\n"
+		"Note that the first line occupies five header lines.\n",
 		0,
 		"64", "header lines" },
-
 	{ "vsl_buffer",
 		tweak_bytes_u, &mgt_param.vsl_buffer, 1024, UINT_MAX,
 		"Bytes of (req-/backend-)workspace dedicated to buffering"



More information about the varnish-commit mailing list