[master] 31d5925e4 Varnishtest: Allow padding up to and including 255 bytes

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Mon Aug 30 08:31:09 UTC 2021


commit 31d5925e45584d36a6133acb6d38d54746e335af
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Tue Jun 22 11:50:07 2021 +0200

    Varnishtest: Allow padding up to and including 255 bytes
    
    According to the spec the padding is an 8-bit field, and fields should be
    treated as unsigned unless otherwise specified, which it is not for any of
    the padding related places. Allow varnishtest to generate padding up to
    255 bytes long.

diff --git a/bin/varnishtest/vtc_http2.c b/bin/varnishtest/vtc_http2.c
index 750d6f074..297045ff9 100644
--- a/bin/varnishtest/vtc_http2.c
+++ b/bin/varnishtest/vtc_http2.c
@@ -1633,8 +1633,8 @@ cmd_tx11obj(CMD_ARGS)
 			exclusive_stream_dependency(s);
 	}
 	if (pad) {
-		if (strlen(pad) >= 128)
-			vtc_fatal(vl, "Padding is limited to 128 bytes");
+		if (strlen(pad) > 255)
+			vtc_fatal(vl, "Padding is limited to 255 bytes");
 		f.flags |= PADDED;
 		assert(f.size + strlen(pad) < BUF_SIZE);
 		memmove(buf + 1, buf, f.size);
@@ -1726,8 +1726,8 @@ cmd_txdata(CMD_ARGS)
 
 	if (pad) {
 		f.flags |= PADDED;
-		if (strlen(pad) >= 128)
-			vtc_fatal(vl, "Padding is limited to 128 bytes");
+		if (strlen(pad) > 255)
+			vtc_fatal(vl, "Padding is limited to 255 bytes");
 		data = malloc( 1 + strlen(body) + strlen(pad));
 		AN(data);
 		*((uint8_t *)data) = strlen(pad);


More information about the varnish-commit mailing list