[master] 9d4797a Allow use of symbolic H2 error names in expect rst.err == BLA
Poul-Henning Kamp
phk at FreeBSD.org
Fri Feb 17 23:48:05 CET 2017
commit 9d4797a088358ac81cef27d2d8887d1063230003
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Fri Feb 17 22:14:31 2017 +0000
Allow use of symbolic H2 error names in expect rst.err == BLA
diff --git a/bin/varnishtest/vtc_http2.c b/bin/varnishtest/vtc_http2.c
index cbd3281..ee6f9c3 100644
--- a/bin/varnishtest/vtc_http2.c
+++ b/bin/varnishtest/vtc_http2.c
@@ -1207,6 +1207,9 @@ cmd_var_resolve(const struct stream *s, const char *spec, char *buf)
else
return (NULL);
}
+#define H2_ERROR(U,v,sc,t) \
+ else if (!strcmp(spec, #U)) { return (#v); }
+#include "tbl/h2_error.h"
else
return (spec);
return(NULL);
diff --git a/include/tbl/h2_error.h b/include/tbl/h2_error.h
index d9bd166..02044db 100644
--- a/include/tbl/h2_error.h
+++ b/include/tbl/h2_error.h
@@ -32,20 +32,20 @@
/*lint -save -e525 -e539 */
-H2_ERROR(NO_ERROR, 0x0,3, "Graceful shutdown")
-H2_ERROR(PROTOCOL_ERROR, 0x1,3, "Protocol error detected")
-H2_ERROR(INTERNAL_ERROR, 0x2,3, "Implementation fault")
-H2_ERROR(FLOW_CONTROL_ERROR, 0x3,3, "Flow-control limits exceeded")
-H2_ERROR(SETTINGS_TIMEOUT, 0x4,1, "Settings not acknowledged")
-H2_ERROR(STREAM_CLOSED, 0x5,2, "Frame received for closed stream")
-H2_ERROR(FRAME_SIZE_ERROR, 0x6,3, "Frame size incorrect")
-H2_ERROR(REFUSED_STREAM, 0x7,2, "Stream not processed")
-H2_ERROR(CANCEL, 0x8,2, "Stream cancelled")
-H2_ERROR(COMPRESSION_ERROR, 0x9,1, "Compression state not updated")
-H2_ERROR(CONNECT_ERROR, 0xa,2, "TCP connection error for CONNECT method")
-H2_ERROR(ENHANCE_YOUR_CALM, 0xb,3, "Processing capacity exceeded")
-H2_ERROR(INADEQUATE_SECURITY,0xc,1, "Negotiated TLS parameters not acceptable")
-H2_ERROR(HTTP_1_1_REQUIRED, 0xd,1, "Use HTTP/1.1 for the request")
+H2_ERROR(NO_ERROR, 0,3, "Graceful shutdown")
+H2_ERROR(PROTOCOL_ERROR, 1,3, "Protocol error detected")
+H2_ERROR(INTERNAL_ERROR, 2,3, "Implementation fault")
+H2_ERROR(FLOW_CONTROL_ERROR, 3,3, "Flow-control limits exceeded")
+H2_ERROR(SETTINGS_TIMEOUT, 4,1, "Settings not acknowledged")
+H2_ERROR(STREAM_CLOSED, 5,2, "Frame received for closed stream")
+H2_ERROR(FRAME_SIZE_ERROR, 6,3, "Frame size incorrect")
+H2_ERROR(REFUSED_STREAM, 7,2, "Stream not processed")
+H2_ERROR(CANCEL, 8,2, "Stream cancelled")
+H2_ERROR(COMPRESSION_ERROR, 9,1, "Compression state not updated")
+H2_ERROR(CONNECT_ERROR, 10,2, "TCP connection error for CONNECT method")
+H2_ERROR(ENHANCE_YOUR_CALM, 11,3, "Processing capacity exceeded")
+H2_ERROR(INADEQUATE_SECURITY, 12,1, "Negotiated TLS parameters not acceptable")
+H2_ERROR(HTTP_1_1_REQUIRED, 13,1, "Use HTTP/1.1 for the request")
#undef H2_ERROR
/*lint -restore */
More information about the varnish-commit
mailing list