[master] ff44f062f param: Turn h2_rxbuf_storage into a string parameter

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Fri Sep 3 10:38:06 UTC 2021


commit ff44f062ff70dfc1dfc7525537c927b8b92f37ce
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Fri Sep 3 12:27:31 2021 +0200

    param: Turn h2_rxbuf_storage into a string parameter
    
    And simply require string parameters to define their tweaks.
    
    Refs #3661

diff --git a/include/tbl/params.h b/include/tbl/params.h
index ade2b944a..4e23d7845 100644
--- a/include/tbl/params.h
+++ b/include/tbl/params.h
@@ -1551,11 +1551,12 @@ PARAM_THREAD(
  * String parameters
  */
 
-#  define PARAM_STRING(nm, pv, def, ...) \
-	PARAM(, , nm, tweak_string, pv, NULL, NULL, def, NULL, __VA_ARGS__)
+#  define PARAM_STRING(nm, tw, pv, def, ...) \
+	PARAM(, , nm, tw, pv, NULL, NULL, def, NULL, __VA_ARGS__)
 
 PARAM_STRING(
 	/* name */	cc_command,
+	/* tweak */	tweak_string,
 	/* priv */	&mgt_cc_cmd,
 	/* def */	VCC_CC,
 	/* descr */
@@ -1566,8 +1567,20 @@ PARAM_STRING(
 	/* flags */	MUST_RELOAD
 )
 
+PARAM_STRING(
+	/* name */	h2_rxbuf_storage,
+	/* tweak */	tweak_h2_rxbuf_storage,
+	/* priv */	&mgt_stv_h2_rxbuf,
+	/* def */	"Transient",
+	/* descr */
+	"The name of the storage backend that HTTP/2 receive buffers "
+	"should be allocated from.",
+	/* flags */	MUST_RESTART
+)
+
 PARAM_STRING(
 	/* name */	vcl_path,
+	/* tweak */	tweak_string,
 	/* priv */	&mgt_vcl_path,
 	/* def */	VARNISH_VCL_DIR,
 	/* descr */
@@ -1582,6 +1595,7 @@ PARAM_STRING(
 
 PARAM_STRING(
 	/* name */	vmod_path,
+	/* tweak */	tweak_string,
 	/* priv */	&mgt_vmod_path,
 	/* def */	VARNISH_VMOD_DIR,
 	/* descr */
@@ -1657,28 +1671,10 @@ PARAM_PCRE2(
 	" messages."
 )
 
-/*--------------------------------------------------------------------
- * Custom parameters with separate tweak function
- */
-
-#  define PARAM_CUSTOM(nm, pv, def, ...) \
-	PARAM(, , nm, tweak_ ## nm, pv, NULL, NULL, def, NULL, __VA_ARGS__)
-
-PARAM_CUSTOM(
-	/* name */	h2_rxbuf_storage,
-	/* priv */	&mgt_stv_h2_rxbuf,
-	/* def */	"Transient",
-	/* descr */
-	"The name of the storage backend that HTTP/2 receive buffers"
-	" should be allocated from.",
-	/* flags */	MUST_RESTART
-)
-
 #  undef PARAM_ALL
 #  undef PARAM_PCRE2
 #  undef PARAM_STRING
 #  undef PARAM_VCC
-#  undef PARAM_CUSTOM
 #endif /* defined(PARAM_ALL) */
 
 #undef PARAM_MEMPOOL


More information about the varnish-commit mailing list