[4.1] d3a0764 Remove the length limit for backends display name

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Fri Sep 4 15:54:55 CEST 2015


commit d3a0764a7f1cc951055b7908f06ae7b61d960161
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Fri Aug 21 17:22:36 2015 +0200

    Remove the length limit for backends display name

diff --git a/bin/varnishd/cache/cache_backend_cfg.c b/bin/varnishd/cache/cache_backend_cfg.c
index 3db5dbd..0a58de1 100644
--- a/bin/varnishd/cache/cache_backend_cfg.c
+++ b/bin/varnishd/cache/cache_backend_cfg.c
@@ -65,7 +65,7 @@ struct director *
 VRT_new_backend(VRT_CTX, const struct vrt_backend *vrt)
 {
 	struct backend *b;
-	char buf[128];
+	struct vsb *vsb;
 	struct vcl *vcl;
 	struct tcp_pool *tp = NULL;
 	const struct vrt_backend_probe *vbp;
@@ -89,8 +89,14 @@ VRT_new_backend(VRT_CTX, const struct vrt_backend *vrt)
 #undef DA
 #undef DN
 
-	bprintf(buf, "%s.%s", VCL_Name(vcl), vrt->vcl_name);
-	REPLACE(b->display_name, buf);
+	vsb = VSB_new_auto();
+	AN(vsb);
+	VSB_printf(vsb, "%s.%s", VCL_Name(vcl), vrt->vcl_name);
+	AZ(VSB_finish(vsb));
+
+	b->display_name = strdup(VSB_data(vsb));
+	AN(b->display_name);
+	VSB_delete(vsb);
 
 	b->vcl = vcl;
 



More information about the varnish-commit mailing list