[master] 13ebfef8f The rest of the previous commit, sorry for the botch.

Poul-Henning Kamp phk at FreeBSD.org
Thu Aug 19 13:02:05 UTC 2021


commit 13ebfef8f730aff9f54211257baa3ddb79632193
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Aug 19 13:01:29 2021 +0000

    The rest of the previous commit, sorry for the botch.

diff --git a/bin/varnishtest/tests/m00000.vtc b/bin/varnishtest/tests/m00000.vtc
index 49c9cc234..d8a9960a1 100644
--- a/bin/varnishtest/tests/m00000.vtc
+++ b/bin/varnishtest/tests/m00000.vtc
@@ -234,10 +234,12 @@ varnish v1 -vcl {
 		};
 
 		#define SETHDR(type)					\
-			VRT_SetHdr(ctx,					\
+			VRT_SetHdr(					\
+			    ctx,					\
 			    &VGC_HDR_RESP_ ## type ## _2d_sizeof,	\
 			    VRT_INT_string(ctx, sizeof(struct type)),	\
-			    vrt_magic_string_end)
+			    0						\
+			)
 	}C
 
 	sub vcl_recv {
diff --git a/bin/varnishtest/tests/r01406.vtc b/bin/varnishtest/tests/r01406.vtc
index ee4e5e498..d4c3de428 100644
--- a/bin/varnishtest/tests/r01406.vtc
+++ b/bin/varnishtest/tests/r01406.vtc
@@ -15,7 +15,12 @@ varnish v1 -arg "-p vcc_allow_inline_c=true" -vcl+backend {
 
 	sub vcl_recv {
 		C{
-			VRT_SetHdr(ctx, &VGC_HDR_REQ_foo, 0, vrt_magic_string_end );
+			VRT_SetHdr(
+			    ctx,
+			    &VGC_HDR_REQ_foo,
+			    0,
+			    &(struct strands){.n = 0}
+			);
 		}C
 	}
 
diff --git a/include/vrt.h b/include/vrt.h
index 8c6678935..b0cae3b9b 100644
--- a/include/vrt.h
+++ b/include/vrt.h
@@ -54,6 +54,7 @@
  * binary/load-time compatible, increment MAJOR version
  *
  * NEXT (2021-09-15)
+ *	VRT_SetHdr() changed to take `const char*` & `STRANDS` arguments.
  *	VRT_UnsetHdr() added
  *	vrt_magic_string_unset removed (use VRT_UnsetHdr() instead)
  *	VNUMpfx() removed, SF_Parse_{Integer|Decimal|Number} added
@@ -596,7 +597,7 @@ VCL_VOID VRT_hit_for_pass(VRT_CTX, VCL_DURATION);
 
 VCL_BOOL VRT_ValidHdr(VRT_CTX, VCL_STRANDS);
 VCL_VOID VRT_UnsetHdr(VRT_CTX, VCL_HEADER);
-VCL_VOID VRT_SetHdr(VRT_CTX, VCL_HEADER, const char *, ...);
+VCL_VOID VRT_SetHdr(VRT_CTX, VCL_HEADER, const char *pfx, VCL_STRANDS);
 VCL_VOID VRT_handling(VRT_CTX, unsigned hand);
 unsigned VRT_handled(VRT_CTX);
 VCL_VOID VRT_fail(VRT_CTX, const char *fmt, ...) v_printflike_(2,3);
diff --git a/lib/libvcc/vcc_action.c b/lib/libvcc/vcc_action.c
index 70e805504..25e2f7a8b 100644
--- a/lib/libvcc/vcc_action.c
+++ b/lib/libvcc/vcc_action.c
@@ -119,8 +119,8 @@ static const struct assign {
 	{ DURATION,	0,		DURATION },
 	{ STRING,	T_INCR,		STRING_LIST, "\v,\n" },
 	{ STRING,	'=',		STRING_LIST },
-	{ HEADER,	T_INCR,		STRING_LIST, "VRT_GetHdr(ctx, \v),\n" },
-	{ HEADER,	'=',		STRING_LIST },
+	{ HEADER,	T_INCR,		STRANDS, "VRT_GetHdr(ctx, \v),\n" },
+	{ HEADER,	'=',		STRANDS, "NULL,\n" },
 	{ BODY,		'=',		STRING_LIST, "LBODY_SET,\n" },
 	{ BODY,		T_INCR,		STRING_LIST, "LBODY_ADD,\n" },
 	{ VOID,		'=',		VOID }


More information about the varnish-commit mailing list