From: Willy Tarreau Date: Mon, 23 Oct 2017 12:39:06 +0000 (+0200) Subject: MINOR: h2: add function h2s_id() to report a stream's ID X-Git-Tag: v1.8-rc1~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71681174f37f3e32eacce1318e09c6d4f0056134;p=thirdparty%2Fhaproxy.git MINOR: h2: add function h2s_id() to report a stream's ID 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. --- diff --git a/src/mux_h2.c b/src/mux_h2.c index bdc21521a5..ea4f90f7a8 100644 --- a/src/mux_h2.c +++ b/src/mux_h2.c @@ -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 or 0 if 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 */ /*********************************************************/