]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: h2: add function h2s_id() to report a stream's ID
authorWilly Tarreau <w@1wt.eu>
Mon, 23 Oct 2017 12:39:06 +0000 (14:39 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 Oct 2017 17:12:14 +0000 (18:12 +0100)
This one supports being called with NULL and returns 0 in this case,
making it easier to check for stream IDs in various send functions.

src/mux_h2.c

index bdc21521a59a008f1c41eeb133c36a9957496842..ea4f90f7a85e526f9cdd4d10a1a837aa5b38d5c6 100644 (file)
@@ -351,6 +351,17 @@ static void h2_release(struct connection *conn)
 }
 
 
+/******************************************************/
+/* functions below are for the H2 protocol processing */
+/******************************************************/
+
+/* returns the stream if of stream <h2s> or 0 if <h2s> is NULL */
+static inline int h2s_id(const struct h2s *h2s)
+{
+       return h2s ? h2s->id : 0;
+}
+
+
 /*********************************************************/
 /* functions below are I/O callbacks from the connection */
 /*********************************************************/