From: Christopher Faulet Date: Wed, 3 Oct 2018 12:25:40 +0000 (+0200) Subject: MINOR: http: Add macros to check if a stream uses the HTX representation X-Git-Tag: v1.9-dev7~75 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1d5b85aba21c1a1170edfb81b60303c73e7f369b;p=thirdparty%2Fhaproxy.git MINOR: http: Add macros to check if a stream uses the HTX representation To prepare the refactoring of the code handling HTTP messages, these macros will help to use HTX functions instead of legacy ones when the new HTX internal representation is in use. To do so, for a given stream, we will check if its frontend has the option PR_O2_USE_HTX. It is useless to test backend options because it is not possible to mix the HTX representation and the legacy one (i.e, having an HTX frontend and a legacy backend or vice versa). --- diff --git a/include/proto/proto_http.h b/include/proto/proto_http.h index 108b7b9409..6b5a5e893b 100644 --- a/include/proto/proto_http.h +++ b/include/proto/proto_http.h @@ -29,6 +29,8 @@ #include #include +#define IS_HTX_STRM(strm) (strm_fe(strm)->options2 & PR_O2_USE_HTX) +#define IS_HTX_SMP(smp) ((smp)->strm && IS_HTX_STRM((smp)->strm)) extern struct pool_head *pool_head_uniqueid;