[master] 890a45a Make server.hostname and server.identity available in all VCL methods.

Poul-Henning Kamp phk at FreeBSD.org
Fri Sep 19 12:29:15 CEST 2014


commit 890a45ae8af9d6e70a2365f209707370af1bc574
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Fri Sep 19 10:28:48 2014 +0000

    Make server.hostname and server.identity available in all VCL methods.
    
    Closes	#1594

diff --git a/bin/varnishd/cache/cache_pool.c b/bin/varnishd/cache/cache_pool.c
index 77524b3..29fc2f3 100644
--- a/bin/varnishd/cache/cache_pool.c
+++ b/bin/varnishd/cache/cache_pool.c
@@ -471,14 +471,13 @@ pool_herder(void *priv)
 	AZ(pthread_attr_init(&tp_attr));
 
 	while (1) {
+		AZ(pthread_attr_destroy(&tp_attr));
+		AZ(pthread_attr_init(&tp_attr));
+
 		/* Set the stacksize for worker threads we create */
 		if (cache_param->wthread_stacksize != UINT_MAX)
 			AZ(pthread_attr_setstacksize(&tp_attr,
 			    cache_param->wthread_stacksize));
-		else {
-			AZ(pthread_attr_destroy(&tp_attr));
-			AZ(pthread_attr_init(&tp_attr));
-		}
 
 		/* Make more threads if needed and allowed */
 		if (pp->nthr < cache_param->wthread_min ||
diff --git a/bin/varnishtest/tests/v00001.vtc b/bin/varnishtest/tests/v00001.vtc
index 1798ec9..822c847 100644
--- a/bin/varnishtest/tests/v00001.vtc
+++ b/bin/varnishtest/tests/v00001.vtc
@@ -32,6 +32,8 @@ varnish v1 -vcl+backend {
 		set beresp.proto = "HTTP/1.2";
 		set beresp.reason = "For circular files";
 		set beresp.status = 903;
+		set beresp.http.y-served-by-hostname = server.hostname;
+		set beresp.http.y-served-by-identity = server.identity;
 	}
 	sub vcl_deliver {
 		set resp.proto = "HTTP/1.2";



More information about the varnish-commit mailing list