]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h2: add a new dummy stream : h2_error_stream
authorWilly Tarreau <w@1wt.eu>
Thu, 3 Jan 2019 11:00:17 +0000 (12:00 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 3 Jan 2019 17:45:38 +0000 (18:45 +0100)
This dummy stream will be used to send stream errors that must not
be retried, such as undecodable headers frames.

src/mux_h2.c

index 2278a49189cad56363cfd1265d6369c17533a191..d7cf2379d909259a0cff202d6aefc80ff4cab16e 100644 (file)
@@ -29,8 +29,9 @@
 #include <eb32tree.h>
 
 
-/* dummy streams returned for closed, refused, idle and states */
+/* dummy streams returned for closed, error, refused, idle and states */
 static const struct h2s *h2_closed_stream;
+static const struct h2s *h2_error_stream;
 static const struct h2s *h2_refused_stream;
 static const struct h2s *h2_idle_stream;
 
@@ -230,6 +231,16 @@ static const struct h2s *h2_closed_stream = &(const struct h2s){
        .id        = 0,
 };
 
+/* a dmumy closed stream returning a PROTOCOL_ERROR error */
+static const struct h2s *h2_error_stream = &(const struct h2s){
+       .cs        = NULL,
+       .h2c       = NULL,
+       .st        = H2_SS_CLOSED,
+       .errcode   = H2_ERR_PROTOCOL_ERROR,
+       .flags     = 0,
+       .id        = 0,
+};
+
 /* a dmumy closed stream returning a REFUSED_STREAM error */
 static const struct h2s *h2_refused_stream = &(const struct h2s){
        .cs        = NULL,