[master] 5a8ec68 SES_RxInit() shouldnt know about the max length of HTTP headers.

Poul-Henning Kamp phk at FreeBSD.org
Tue Apr 5 12:13:05 CEST 2016


commit 5a8ec687e7f907cd7766d441fc41458cedd922d2
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Apr 5 07:33:50 2016 +0000

    SES_RxInit() shouldnt know about the max length of HTTP headers.

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index 44f1c81..3444656 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -963,8 +963,7 @@ enum htc_status_e {
 	HTC_S_IDLE =		 3,
 };
 
-void SES_RxInit(struct http_conn *htc, struct ws *ws,
-    unsigned maxbytes, unsigned maxhdr);
+void SES_RxInit(struct http_conn *htc, struct ws *ws, unsigned maxbytes);
 void SES_RxReInit(struct http_conn *htc);
 enum htc_status_e SES_RxStuff(struct http_conn *, htc_complete_f *,
     double *t1, double *t2, double ti, double tn);
diff --git a/bin/varnishd/cache/cache_acceptor.c b/bin/varnishd/cache/cache_acceptor.c
index 42fd3f0..982e1e8 100644
--- a/bin/varnishd/cache/cache_acceptor.c
+++ b/bin/varnishd/cache/cache_acceptor.c
@@ -376,8 +376,7 @@ vca_make_session(struct worker *wrk, void *arg)
 	req = Req_New(wrk, sp);
 	CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
 	req->htc->fd = sp->fd;
-	SES_RxInit(req->htc, req->ws,
-	    cache_param->http_req_size, cache_param->http_req_hdr_len);
+	SES_RxInit(req->htc, req->ws, cache_param->http_req_size);
 
 	SES_SetTransport(wrk, sp, req, wa->acceptlsock->transport);
 }
diff --git a/bin/varnishd/cache/cache_session.c b/bin/varnishd/cache/cache_session.c
index 4208fc5..b96aa9a 100644
--- a/bin/varnishd/cache/cache_session.c
+++ b/bin/varnishd/cache/cache_session.c
@@ -183,14 +183,12 @@ SES_Get_String_Attr(const struct sess *sp, enum sess_attr a)
 /*--------------------------------------------------------------------*/
 
 void
-SES_RxInit(struct http_conn *htc, struct ws *ws, unsigned maxbytes,
-    unsigned maxhdr)
+SES_RxInit(struct http_conn *htc, struct ws *ws, unsigned maxbytes)
 {
 
 	htc->magic = HTTP_CONN_MAGIC;
 	htc->ws = ws;
 	htc->maxbytes = maxbytes;
-	htc->maxhdr = maxhdr;
 
 	(void)WS_Reserve(htc->ws, htc->maxbytes);
 	htc->rxbuf_b = ws->f;
diff --git a/bin/varnishd/http1/cache_http1_fetch.c b/bin/varnishd/http1/cache_http1_fetch.c
index ef24a71..2c92ab6 100644
--- a/bin/varnishd/http1/cache_http1_fetch.c
+++ b/bin/varnishd/http1/cache_http1_fetch.c
@@ -149,8 +149,7 @@ V1F_FetchRespHdr(struct busyobj *bo)
 
 	/* Receive response */
 
-	SES_RxInit(htc, bo->ws, cache_param->http_resp_size,
-	    cache_param->http_resp_hdr_len);
+	SES_RxInit(htc, bo->ws, cache_param->http_resp_size);
 	CHECK_OBJ_NOTNULL(htc, HTTP_CONN_MAGIC);
 	CHECK_OBJ_NOTNULL(bo->htc, HTTP_CONN_MAGIC);
 
diff --git a/bin/varnishd/http1/cache_http1_fsm.c b/bin/varnishd/http1/cache_http1_fsm.c
index 073684e..9dd8b3b 100644
--- a/bin/varnishd/http1/cache_http1_fsm.c
+++ b/bin/varnishd/http1/cache_http1_fsm.c
@@ -130,8 +130,7 @@ http1_unwait(struct worker *wrk, void *arg)
 	req = Req_New(wrk, sp);
 	CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
 	req->htc->fd = sp->fd;
-	SES_RxInit(req->htc, req->ws,
-	    cache_param->http_req_size, cache_param->http_req_hdr_len);
+	SES_RxInit(req->htc, req->ws, cache_param->http_req_size);
 	http1_setstate(sp, H1NEWREQ);
 	wrk->task.func = http1_req;
 	wrk->task.priv = req;
diff --git a/bin/varnishd/http1/cache_http1_proto.c b/bin/varnishd/http1/cache_http1_proto.c
index 412370a..56d9cc1 100644
--- a/bin/varnishd/http1/cache_http1_proto.c
+++ b/bin/varnishd/http1/cache_http1_proto.c
@@ -349,6 +349,7 @@ HTTP1_DissectRequest(struct http_conn *htc, struct http *hp)
 	CHECK_OBJ_NOTNULL(htc, HTTP_CONN_MAGIC);
 	CHECK_OBJ_NOTNULL(hp, HTTP_MAGIC);
 
+	htc->maxhdr = cache_param->http_req_hdr_len;
 	retval = http1_splitline(hp, htc, HTTP1_Req);
 	if (retval != 0)
 		return (retval);
@@ -414,6 +415,7 @@ HTTP1_DissectResponse(struct http_conn *htc, struct http *hp,
 	CHECK_OBJ_NOTNULL(hp, HTTP_MAGIC);
 	CHECK_OBJ_NOTNULL(req, HTTP_MAGIC);
 
+	htc->maxhdr = cache_param->http_resp_hdr_len;
 	if (http1_splitline(hp, htc, HTTP1_Resp))
 		retval = 503;
 



More information about the varnish-commit mailing list