Permalink
Browse files

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

  • Loading branch information...
1 parent 77cab36 commit 3f46e4f890914a54d091077a368ae9337b4f62c2 @bsdphk bsdphk committed Feb 16, 2017
Showing with 19 additions and 17 deletions.
  1. +1 −1 bin/varnishd/http2/cache_http2.h
  2. +1 −1 bin/varnishtest/tests/t02000.vtc
  3. +1 −1 bin/varnishtest/vtc_http2.c
  4. +16 −14 include/tbl/h2_error.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"
};
@@ -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
@@ -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>
NULL
};
@@ -26,24 +26,26 @@
* SUCH DAMAGE.
*
* 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 */

0 comments on commit 3f46e4f

Please sign in to comment.