[master] ff61fc3 Rename the 'sess_workspace' param to 'workspace_client'.

Poul-Henning Kamp phk at varnish-cache.org
Sun Dec 25 11:57:23 CET 2011


commit ff61fc3496a5f299617c7a026f10d129ef0e9297
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Sun Dec 25 10:55:47 2011 +0000

    Rename the 'sess_workspace' param to 'workspace_client'.
    
    I'm not quite there yet, but in the end we will have two workspaces:
    req->ws for req.* and resp.* and busyobj->ws for bereq.* and beresp.*
    
    Various argument changes as consequence of the sess->req moves.

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index 9743398..50c1ec0 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -761,7 +761,7 @@ int FetchError(struct worker *w, const char *error);
 int FetchError2(struct worker *w, const char *error, const char *more);
 int FetchHdr(struct sess *sp, int need_host_hdr);
 int FetchBody(struct worker *w, struct object *obj);
-int FetchReqBody(struct sess *sp);
+int FetchReqBody(const struct sess *sp);
 void Fetch_Init(void);
 
 /* cache_gzip.c */
@@ -825,7 +825,7 @@ double http_GetHdrQ(const struct http *hp, const char *hdr, const char *field);
 uint16_t http_GetStatus(const struct http *hp);
 const char *http_GetReq(const struct http *hp);
 int http_HdrIs(const struct http *hp, const char *hdr, const char *val);
-uint16_t http_DissectRequest(struct sess *sp);
+uint16_t http_DissectRequest(const struct sess *sp);
 uint16_t http_DissectResponse(struct worker *w, const struct http_conn *htc,
     struct http *sp);
 const char *http_DoConnection(const struct http *hp);
@@ -910,13 +910,13 @@ void WRW_Sendfile(struct worker *w, int fd, off_t off, unsigned len);
 #endif  /* SENDFILE_WORKS */
 
 /* cache_session.c [SES] */
-struct sess *SES_New(struct worker *wrk, struct sesspool *pp);
+struct sess *SES_New(struct sesspool *pp);
 struct sess *SES_Alloc(void);
 void SES_Close(struct sess *sp, const char *reason);
 void SES_Delete(struct sess *sp, const char *reason, double now);
 void SES_Charge(struct sess *sp);
 struct sesspool *SES_NewPool(struct pool *pp, unsigned pool_no);
-void SES_DeletePool(struct sesspool *sp, struct worker *wrk);
+void SES_DeletePool(struct sesspool *sp);
 int SES_Schedule(struct sess *sp);
 void SES_Handle(struct sess *sp, double now);
 void SES_GetReq(struct sess *sp);
@@ -966,7 +966,7 @@ void RES_StreamPoll(struct worker *);
 
 /* cache_vary.c */
 struct vsb *VRY_Create(const struct sess *sp, const struct http *hp);
-int VRY_Match(struct sess *sp, const uint8_t *vary);
+int VRY_Match(const struct sess *sp, const uint8_t *vary);
 void VRY_Validate(const uint8_t *vary);
 
 /* cache_vcl.c */
diff --git a/bin/varnishd/cache/cache_ban.c b/bin/varnishd/cache/cache_ban.c
index 9162f50..a884983 100644
--- a/bin/varnishd/cache/cache_ban.c
+++ b/bin/varnishd/cache/cache_ban.c
@@ -618,9 +618,11 @@ ban_evaluate(const uint8_t *bs, const struct http *objhttp,
 		arg1 = NULL;
 		switch (bt.arg1) {
 		case BAN_ARG_URL:
+			AN(reqhttp);
 			arg1 = reqhttp->hd[HTTP_HDR_URL].b;
 			break;
 		case BAN_ARG_REQHTTP:
+			AN(reqhttp);
 			(void)http_GetHdr(reqhttp, bt.arg1_spec, &arg1);
 			break;
 		case BAN_ARG_OBJHTTP:
diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 1e75f64..2e65591 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -329,7 +329,7 @@ fetch_eof(struct worker *wrk, struct http_conn *htc)
  */
 
 int
-FetchReqBody(struct sess *sp)
+FetchReqBody(const struct sess *sp)
 {
 	unsigned long content_length;
 	char buf[8192];
diff --git a/bin/varnishd/cache/cache_http.c b/bin/varnishd/cache/cache_http.c
index f7dad38..cb17df4 100644
--- a/bin/varnishd/cache/cache_http.c
+++ b/bin/varnishd/cache/cache_http.c
@@ -651,7 +651,7 @@ http_ProtoVer(struct http *hp)
 /*--------------------------------------------------------------------*/
 
 uint16_t
-http_DissectRequest(struct sess *sp)
+http_DissectRequest(const struct sess *sp)
 {
 	struct http_conn *htc;
 	struct http *hp;
diff --git a/bin/varnishd/cache/cache_pool.c b/bin/varnishd/cache/cache_pool.c
index 1a67548..8ab73fe 100644
--- a/bin/varnishd/cache/cache_pool.c
+++ b/bin/varnishd/cache/cache_pool.c
@@ -238,7 +238,7 @@ Pool_Work_Thread(void *priv, struct worker *w)
 			/* Turn accepted socket into a session */
 			AZ(w->sp);
 			AN(w->ws->r);
-			w->sp = SES_New(w, pp->sesspool);
+			w->sp = SES_New(pp->sesspool);
 			if (w->sp == NULL) {
 				VCA_FailSess(w);
 				w->do_what = pool_do_nothing;
@@ -538,7 +538,7 @@ pool_poolherder(void *priv)
 		}
 		/* XXX: remove pools */
 		if (0)
-			SES_DeletePool(NULL, NULL);
+			SES_DeletePool(NULL);
 		(void)sleep(1);
 		u = 0;
 		VTAILQ_FOREACH(pp, &pools, list)
diff --git a/bin/varnishd/cache/cache_session.c b/bin/varnishd/cache/cache_session.c
index 552c078..0091407 100644
--- a/bin/varnishd/cache/cache_session.c
+++ b/bin/varnishd/cache/cache_session.c
@@ -98,11 +98,10 @@ ses_setup(struct sess *sp)
  */
 
 struct sess *
-SES_New(struct worker *wrk, struct sesspool *pp)
+SES_New(struct sesspool *pp)
 {
 	struct sess *sp;
 
-	(void)wrk;					// XXX
 	CHECK_OBJ_NOTNULL(pp, SESSPOOL_MAGIC);
 	sp = MPL_Get(pp->mpl_sess, NULL);
 	sp->magic = SESS_MAGIC;
@@ -280,7 +279,7 @@ SES_GetReq(struct sess *sp)
 	sp->req->http0 = HTTP_create(p, nhttp);
 	p += hl;
 	sz -= hl;
-	
+
 	WS_Init(sp->req->ws, "req", p, sz);
 }
 
@@ -314,17 +313,16 @@ SES_NewPool(struct pool *wp, unsigned pool_no)
 	pp->pool = wp;
 	bprintf(nb, "req%u", pool_no);
 	pp->mpl_req = MPL_New(nb, &cache_param->req_pool,
-	    &cache_param->sess_workspace);
+	    &cache_param->workspace_client);
 	pp->mpl_sess = MPL_New(nb, &cache_param->sess_pool, &ses_size);
 	return (pp);
 }
 
 void
-SES_DeletePool(struct sesspool *pp, struct worker *wrk)
+SES_DeletePool(struct sesspool *pp)
 {
 
 	CHECK_OBJ_NOTNULL(pp, SESSPOOL_MAGIC);
-	CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
 	MPL_Destroy(&pp->mpl_sess);
 	MPL_Destroy(&pp->mpl_req);
 	FREE_OBJ(pp);
diff --git a/bin/varnishd/cache/cache_vary.c b/bin/varnishd/cache/cache_vary.c
index a5070cd..d524fd3 100644
--- a/bin/varnishd/cache/cache_vary.c
+++ b/bin/varnishd/cache/cache_vary.c
@@ -174,7 +174,7 @@ vry_cmp(const uint8_t * const *v1, uint8_t * const *v2)
 }
 
 int
-VRY_Match(struct sess *sp, const uint8_t *vary)
+VRY_Match(const struct sess *sp, const uint8_t *vary)
 {
 	uint8_t *vsp = sp->req->vary_b;
 	char *h, *e;
diff --git a/bin/varnishd/common/params.h b/bin/varnishd/common/params.h
index ca39ff7..6c1899a 100644
--- a/bin/varnishd/common/params.h
+++ b/bin/varnishd/common/params.h
@@ -75,7 +75,7 @@ struct params {
 	unsigned		queue_max;
 
 	/* Memory allocation hints */
-	unsigned		sess_workspace;
+	unsigned		workspace_client;
 	unsigned		shm_workspace;
 	unsigned		http_req_size;
 	unsigned		http_req_hdr_len;
diff --git a/bin/varnishd/mgt/mgt_param.c b/bin/varnishd/mgt/mgt_param.c
index 36f96cd..c488f23 100644
--- a/bin/varnishd/mgt/mgt_param.c
+++ b/bin/varnishd/mgt/mgt_param.c
@@ -687,12 +687,9 @@ static const struct parspec input_parspec[] = {
 		"flush of the cache use \"ban.url .\"",
 		0,
 		"120", "seconds" },
-	{ "sess_workspace",
-		tweak_bytes_u, &mgt_param.sess_workspace, 3072, UINT_MAX,
-		"Bytes of HTTP protocol workspace allocated for sessions. "
-		"This space must be big enough for the entire HTTP protocol "
-		"header and any edits done to it in the VCL code.\n"
-		"Minimum is 1024 bytes.",
+	{ "workspace_client",
+		tweak_bytes_u, &mgt_param.workspace_client, 3072, UINT_MAX,
+		"Bytes of HTTP protocol workspace for clients HTTP req/resp.",
 		DELAYED_EFFECT,
 		"64k", "bytes" },
 	{ "http_req_hdr_len",
diff --git a/bin/varnishtest/tests/e00022.vtc b/bin/varnishtest/tests/e00022.vtc
index 39302b4..897f3ee 100644
--- a/bin/varnishtest/tests/e00022.vtc
+++ b/bin/varnishtest/tests/e00022.vtc
@@ -14,7 +14,7 @@ server s1 {
 	}
 } -start
 
-varnish v1 -arg "-p sess_workspace=131072 -p thread_pool_stack=262144" -vcl+backend {
+varnish v1 -arg "-p thread_pool_stack=262144" -vcl+backend {
 	sub vcl_recv {
 		set req.esi = true;
 	}
diff --git a/bin/varnishtest/tests/r00693.vtc b/bin/varnishtest/tests/r00693.vtc
index 24b6827..ff99ca7 100644
--- a/bin/varnishtest/tests/r00693.vtc
+++ b/bin/varnishtest/tests/r00693.vtc
@@ -17,7 +17,7 @@ server s1 {
 
 } -start
 
-varnish v1 -arg "-p sess_workspace=3072" -vcl+backend {
+varnish v1 -arg "-p workspace_client=3072" -vcl+backend {
 
 	sub vcl_recv {
 		set req.http.foo = 
diff --git a/include/tbl/vsc_f_main.h b/include/tbl/vsc_f_main.h
index d63b187..4963b7d 100644
--- a/include/tbl/vsc_f_main.h
+++ b/include/tbl/vsc_f_main.h
@@ -145,36 +145,6 @@ VSC_F(fetch_204,		uint64_t, 1, 'a', "Fetch no body (204)", "")
 VSC_F(fetch_304,		uint64_t, 1, 'a', "Fetch no body (304)", "")
 
 /*---------------------------------------------------------------------
- * Session Memory
- *    see: cache_session.c
- */
-
-VSC_F(sessmem_size,		uint64_t, 1, 'g',
-    "Session mem size",
-	"Bytes of memory allocated for last allocated session."
-)
-
-VSC_F(sessmem_alloc,		uint64_t, 1, 'c',
-    "Session mem allocated",
-	"Count of all allocations of session memory."
-)
-
-VSC_F(sessmem_free,		uint64_t, 1, 'c',
-    "Session mem freed",
-	"Count of all frees of session memory."
-)
-
-VSC_F(sessmem_fail,		uint64_t, 1, 'c',
-    "Session mem alloc failed",
-	"Count of session memory allocation failures."
-)
-
-VSC_F(sessmem_limit,		uint64_t, 1, 'c',
-    "Session mem alloc limited",
-	"Count of session memory allocations blocked by limit (max_sess)."
-)
-
-/*---------------------------------------------------------------------
  * Pools, threads, and sessions
  *    see: cache_pool.c
  *
@@ -252,8 +222,6 @@ VSC_F(busyobj_free,		uint64_t, 1, 'c',
 
 /*---------------------------------------------------------------------*/
 
-VSC_F(n_sess_mem,		uint64_t, 0, 'i', "N struct sess_mem", "")
-VSC_F(n_sess,			uint64_t, 0, 'i', "N struct sess", "")
 VSC_F(n_object,			uint64_t, 1, 'i', "N struct object", "")
 VSC_F(n_vampireobject,		uint64_t, 1, 'i', "N unresurrected objects", "")
 VSC_F(n_objectcore,		uint64_t, 1, 'i', "N struct objectcore", "")



More information about the varnish-commit mailing list