[master] 9fd7bb7 Drop PRIV_SESS, as agreed on VDD14Q4.

Dag Haavi Finstad daghf at varnish-software.com
Thu Nov 27 17:00:38 CET 2014


commit 9fd7bb7482dbc6d7c6817bd78dd2bd79732f9123
Author: Dag Haavi Finstad <daghf at varnish-software.com>
Date:   Tue Nov 25 14:10:37 2014 +0100

    Drop PRIV_SESS, as agreed on VDD14Q4.

diff --git a/bin/varnishd/cache/cache_session.c b/bin/varnishd/cache/cache_session.c
index 7749216..724b1a0 100644
--- a/bin/varnishd/cache/cache_session.c
+++ b/bin/varnishd/cache/cache_session.c
@@ -300,7 +300,7 @@ SES_Delete(struct sess *sp, enum sess_close reason, double now)
 		now = VTIM_real();
 	AZ(isnan(sp->t_open));
 
-	VRTPRIV_dynamic_kill(sp, 0);
+	assert(VTAILQ_EMPTY(&sp->privs));
 	VSL(SLT_SessClose, sp->vxid, "%s %.3f",
 	    sess_close_2str(sp->reason, 0), now - sp->t_open);
 	VSL(SLT_End, sp->vxid, "%s", "");
diff --git a/bin/varnishd/cache/cache_vrt_priv.c b/bin/varnishd/cache/cache_vrt_priv.c
index 4998e74..482e34d 100644
--- a/bin/varnishd/cache/cache_vrt_priv.c
+++ b/bin/varnishd/cache/cache_vrt_priv.c
@@ -89,8 +89,6 @@ VRTPRIV_dynamic_kill(struct sess *sp, uintptr_t id)
 			FREE_OBJ(vps);
 		}
 	}
-	if (id == 0)
-		assert(VTAILQ_EMPTY(&sp->privs));
 }
 
 struct vmod_priv *
@@ -99,12 +97,6 @@ VRT_priv_req(VRT_CTX, void *vmod_id)
 	return (VRT_priv_dynamic(ctx, (uintptr_t)ctx->req, (uintptr_t)vmod_id));
 }
 
-struct vmod_priv *
-VRT_priv_sess(VRT_CTX, void *vmod_id)
-{
-	return (VRT_priv_dynamic(ctx, (uintptr_t)NULL, (uintptr_t)vmod_id));
-}
-
 /*--------------------------------------------------------------------
  */
 
diff --git a/bin/varnishtest/tests/v00041.vtc b/bin/varnishtest/tests/v00041.vtc
index af951f9..2be9f8a 100644
--- a/bin/varnishtest/tests/v00041.vtc
+++ b/bin/varnishtest/tests/v00041.vtc
@@ -1,4 +1,4 @@
-varnishtest "Test priv_sess and priv_req"
+varnishtest "Test priv_req"
 
 server s1 {
 	rxreq
@@ -12,14 +12,11 @@ varnish v1 -vcl+backend {
 
 	sub vcl_recv {
 		set req.http.x0 = debug.test_priv_req(req.url);
-		set req.http.y0 = debug.test_priv_sess(req.url);
 	}
 
 	sub vcl_deliver {
 		set resp.http.x0 = req.http.x0;
 		set resp.http.x1 = debug.test_priv_req("");
-		set resp.http.y0 = req.http.y0;
-		set resp.http.y1 = debug.test_priv_sess("");
 	}
 } -start
 
@@ -29,13 +26,9 @@ client c1 {
 	rxresp
 	expect resp.http.x0 == /foobar
 	expect resp.http.x1 == /foobar
-	expect resp.http.y0 == /foobar
-	expect resp.http.y1 == /foobar
 
 	txreq -url /snafu
 	rxresp
 	expect resp.http.x0 == /snafu
 	expect resp.http.x1 == /snafu
-	expect resp.http.y0 == /foobar
-	expect resp.http.y1 == /foobar
 } -run
diff --git a/include/vrt.h b/include/vrt.h
index f9624a6..78cf479 100644
--- a/include/vrt.h
+++ b/include/vrt.h
@@ -246,7 +246,6 @@ struct vmod_priv {
 typedef int vmod_init_f(struct vmod_priv *,  const struct VCL_conf *);
 
 void VRT_priv_fini(const struct vmod_priv *p);
-struct vmod_priv *VRT_priv_sess(VRT_CTX, void *vmod_id);
 struct vmod_priv *VRT_priv_req(VRT_CTX, void *vmod_id);
 
 /* Stevedore related functions */
diff --git a/lib/libvcc/vcc_expr.c b/lib/libvcc/vcc_expr.c
index 2eb9e73..72d8386 100644
--- a/lib/libvcc/vcc_expr.c
+++ b/lib/libvcc/vcc_expr.c
@@ -557,12 +557,6 @@ vcc_priv_arg(struct vcc *tl, const char *p, const char *name)
 		e2 = vcc_mk_expr(VOID,
 		    "VRT_priv_req(ctx, &VGC_vmod_%.*s)",
 		    (int) (r - name), name);
-	} else if (!strcmp(p, "PRIV_SESS")) {
-		r = strchr(name, '.');
-		AN(r);
-		e2 = vcc_mk_expr(VOID,
-		    "VRT_priv_sess(ctx, &VGC_vmod_%.*s)",
-		    (int) (r - name), name);
 	} else {
 		WRONG("Wrong PRIV_ type");
 	}
diff --git a/lib/libvcc/vmodtool.py b/lib/libvcc/vmodtool.py
index 2d335fc..ef6ea2c 100755
--- a/lib/libvcc/vmodtool.py
+++ b/lib/libvcc/vmodtool.py
@@ -58,7 +58,6 @@ ctypes = {
 	'IP':		"VCL_IP",
 	'PRIV_CALL':	"struct vmod_priv *",
 	'PRIV_VCL':	"struct vmod_priv *",
-	'PRIV_SESS':	"struct vmod_priv *",
 	'PRIV_REQ':	"struct vmod_priv *",
 	'REAL':		"VCL_REAL",
 	'STRING':	"VCL_STRING",
diff --git a/lib/libvmod_debug/vmod.vcc b/lib/libvmod_debug/vmod.vcc
index 468fc51..09e6c0b 100644
--- a/lib/libvmod_debug/vmod.vcc
+++ b/lib/libvmod_debug/vmod.vcc
@@ -55,10 +55,6 @@ $Function STRING test_priv_req(PRIV_REQ, STRING)
 
 Test function for REQ private pointers
 
-$Function STRING test_priv_sess(PRIV_SESS, STRING)
-
-Test function for SESS private pointers
-
 $Function BLOB str2blob(STRING src)
 
 Turn a string into a blob
diff --git a/lib/libvmod_debug/vmod_debug.c b/lib/libvmod_debug/vmod_debug.c
index 08b5aa8..d8077ce 100644
--- a/lib/libvmod_debug/vmod_debug.c
+++ b/lib/libvmod_debug/vmod_debug.c
@@ -88,18 +88,6 @@ vmod_test_priv_call(VRT_CTX, struct vmod_priv *priv)
 	}
 }
 
-VCL_STRING __match_proto__(td_debug_test_priv_sess)
-vmod_test_priv_sess(VRT_CTX, struct vmod_priv *priv, VCL_STRING s)
-{
-
-	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
-	if (priv->priv == NULL) {
-		priv->priv = strdup(s);
-		priv->free = free;
-	}
-	return (priv->priv);
-}
-
 VCL_STRING __match_proto__(td_debug_test_priv_req)
 vmod_test_priv_req(VRT_CTX, struct vmod_priv *priv, VCL_STRING s)
 {



More information about the varnish-commit mailing list