[master] a5ce998 Split the http_max_hdr parameter into http_resp_max_hdr and http_req_max_hdr.

Poul-Henning Kamp phk at varnish-cache.org
Mon Jan 14 09:55:30 CET 2013


commit a5ce9982d87a4398b45886f74306a0ed4d6b1829
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Mon Jan 14 08:55:09 2013 +0000

    Split the http_max_hdr parameter into http_resp_max_hdr and http_req_max_hdr.

diff --git a/bin/varnishd/cache/cache_busyobj.c b/bin/varnishd/cache/cache_busyobj.c
index 0691b83..4bf5ad2 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_max_hdr;
+	nhttp = (uint16_t)cache_param->http_resp_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 547755a..946d867 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_max_hdr);
+	    (uint16_t)cache_param->http_req_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 5fae4dd..40416a0 100644
--- a/bin/varnishd/cache/cache_session.c
+++ b/bin/varnishd/cache/cache_session.c
@@ -365,7 +365,7 @@ SES_GetReq(struct worker *wrk, struct sess *sp)
 	p = (void*)PRNDUP(p);
 	assert(p < e);
 
-	nhttp = (uint16_t)cache_param->http_max_hdr;
+	nhttp = (uint16_t)cache_param->http_req_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 a6e881b..42e169f 100644
--- a/bin/varnishd/common/params.h
+++ b/bin/varnishd/common/params.h
@@ -98,9 +98,10 @@ 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_max_hdr;
+	unsigned		http_resp_max_hdr;
 
 	unsigned		shm_reclen;
 
diff --git a/bin/varnishd/mgt/mgt_param_tbl.c b/bin/varnishd/mgt/mgt_param_tbl.c
index cb54111..e5d709f 100644
--- a/bin/varnishd/mgt/mgt_param_tbl.c
+++ b/bin/varnishd/mgt/mgt_param_tbl.c
@@ -86,6 +86,7 @@ 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,
@@ -104,6 +105,16 @@ 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,
@@ -122,14 +133,16 @@ const struct parspec mgt_parspec[] = {
 		"limits how much of that the request is allowed to take up.",
 		0,
 		"32k", "bytes" },
-	{ "http_max_hdr", tweak_uint, &mgt_param.http_max_hdr, 32, 65535,
+	{ "http_resp_max_hdr", tweak_uint, &mgt_param.http_resp_max_hdr,
+		32, 65535,
 		"Maximum number of HTTP headers we will deal with in "
-		"client request or backend reponses.  "
+		"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",
 		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