[master] 3f46e4f Add a field which says if H2 error is stream and/or connection error.

Poul-Henning Kamp phk at FreeBSD.org
Fri Feb 17 12:36:05 CET 2017

commit 3f46e4f890914a54d091077a368ae9337b4f62c2
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Feb 16 15:39:12 2017 +0000

    Add a field which says if H2 error is stream and/or connection error.

diff --git a/bin/varnishd/http2/cache_http2.h b/bin/varnishd/http2/cache_http2.h
index 2fe1c23..d9a231f 100644
--- a/bin/varnishd/http2/cache_http2.h
+++ b/bin/varnishd/http2/cache_http2.h
@@ -33,7 +33,7 @@ struct h2_sess;
 enum h2_error_e {
 	H2E__DUMMY = -1,
-#define H2_ERROR(NAME, val, desc)		\
+#define H2_ERROR(NAME, val, sc, desc) \
 	H2E_##NAME = val,
 #include "tbl/h2_error.h"
diff --git a/bin/varnishtest/tests/t02000.vtc b/bin/varnishtest/tests/t02000.vtc
index 2cd7610..2bdfac9 100644
--- a/bin/varnishtest/tests/t02000.vtc
+++ b/bin/varnishtest/tests/t02000.vtc
@@ -13,7 +13,7 @@ varnish v1 -cliok "param.set debug +syncvsl"
 client c1 {
 	stream 1 {
-		txprio -weight 10 -stream 0 
+		txprio -weight 10 -stream 0
 	} -run
 	stream 3 {
 		txprio -weight 10 -stream 0
diff --git a/bin/varnishtest/vtc_http2.c b/bin/varnishtest/vtc_http2.c
index 5b6b9c2..e87fd88 100644
--- a/bin/varnishtest/vtc_http2.c
+++ b/bin/varnishtest/vtc_http2.c
@@ -56,7 +56,7 @@
 #define BUF_SIZE	(1024*2048)
 static const char *const h2_errs[] = {
-#define H2_ERROR(n,v,t)	[v] = #n,
+#define H2_ERROR(n,v,sc,t) [v] = #n,
 #include <tbl/h2_error.h>
diff --git a/include/tbl/h2_error.h b/include/tbl/h2_error.h
index c946454..2e157f7 100644
--- a/include/tbl/h2_error.h
+++ b/include/tbl/h2_error.h
@@ -26,24 +26,26 @@
  * RFC7540 section 11.4
+ *
+ * Fields: Upper, value, conn=1|stream=2, description
 /*lint -save -e525 -e539 */
-H2_ERROR(NO_ERROR,		0x0, "Graceful shutdown")
-H2_ERROR(PROTOCOL_ERROR,	0x1, "Protocol error detected")
-H2_ERROR(INTERNAL_ERROR,	0x2, "Implementation fault")
-H2_ERROR(FLOW_CONTROL_ERROR,	0x3, "Flow-control limits exceeded")
-H2_ERROR(SETTINGS_TIMEOUT,	0x4, "Settings not acknowledged")
-H2_ERROR(STREAM_CLOSED,		0x5, "Frame received for closed stream")
-H2_ERROR(FRAME_SIZE_ERROR,	0x6, "Frame size incorrect")
-H2_ERROR(REFUSED_STREAM,	0x7, "Stream not processed")
-H2_ERROR(CANCEL,		0x8, "Stream cancelled")
-H2_ERROR(COMPRESSION_ERROR,	0x9, "Compression state not updated")
-H2_ERROR(CONNECT_ERROR,		0xa, "TCP connection error for CONNECT method")
-H2_ERROR(ENHANCE_YOUR_CALM,	0xb, "Processing capacity exceeded")
-H2_ERROR(INADEQUATE_SECURITY,	0xc, "Negotiated TLS parameters not acceptable")
-H2_ERROR(HTTP_1_1_REQUIRED,	0xd, "Use HTTP/1.1 for the request")
+H2_ERROR(NO_ERROR,	     0x0,0, "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")
 #undef H2_ERROR
 /*lint -restore */

More information about the varnish-commit mailing list