From: Christopher Faulet Date: Tue, 8 Oct 2019 12:27:52 +0000 (+0200) Subject: MINOR: htx: Add 2 flags on the start-line to have more info about the uri X-Git-Tag: v2.1-dev3~132 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9a67c293b9477b6bdac0e62278a70d444dc7f074;p=thirdparty%2Fhaproxy.git MINOR: htx: Add 2 flags on the start-line to have more info about the uri The first flag, HTX_SL_F_HAS_AUTHORITY, is set when the uri contains an authority. For the H1, it happens when a CONNECT request is received or when an absolute uri is used. For the H2, it happens when the pseudo header ":authority" is provided. The second one, HTX_SL_F_NORMALIZED_URI, is set when the received uri is represented as an absolute uri because of the protocol requirements. For now, it is only used for h2 requests, when the pseudo headers :authority and :scheme are found. Internally, the uri is represented as an absolute uri. This flag allows us to make the difference between an absolute uri in h1 and h2. --- diff --git a/include/common/htx.h b/include/common/htx.h index aa0176f837..da035b9a7c 100644 --- a/include/common/htx.h +++ b/include/common/htx.h @@ -129,17 +129,20 @@ */ /* HTX start-line flags */ -#define HTX_SL_F_NONE 0x00000000 -#define HTX_SL_F_IS_RESP 0x00000001 /* It is the response start-line (unset means the request one) */ -#define HTX_SL_F_XFER_LEN 0x00000002 /* The message xfer size can be dertermined */ -#define HTX_SL_F_XFER_ENC 0x00000004 /* The transfer-encoding header was found in message */ -#define HTX_SL_F_CLEN 0x00000008 /* The content-length header was found in message */ -#define HTX_SL_F_CHNK 0x00000010 /* The message payload is chunked */ -#define HTX_SL_F_VER_11 0x00000020 /* The message indicates version 1.1 or above */ -#define HTX_SL_F_BODYLESS 0x00000040 /* The message has no body (content-length = 0) */ -#define HTX_SL_F_HAS_SCHM 0x00000080 /* The scheme is explicitly specified */ -#define HTX_SL_F_SCHM_HTTP 0x00000100 /* The scheme HTTP should be used */ -#define HTX_SL_F_SCHM_HTTPS 0x00000200 /* The scheme HTTPS should be used */ +#define HTX_SL_F_NONE 0x00000000 +#define HTX_SL_F_IS_RESP 0x00000001 /* It is the response start-line (unset means the request one) */ +#define HTX_SL_F_XFER_LEN 0x00000002 /* The message xfer size can be dertermined */ +#define HTX_SL_F_XFER_ENC 0x00000004 /* The transfer-encoding header was found in message */ +#define HTX_SL_F_CLEN 0x00000008 /* The content-length header was found in message */ +#define HTX_SL_F_CHNK 0x00000010 /* The message payload is chunked */ +#define HTX_SL_F_VER_11 0x00000020 /* The message indicates version 1.1 or above */ +#define HTX_SL_F_BODYLESS 0x00000040 /* The message has no body (content-length = 0) */ +#define HTX_SL_F_HAS_SCHM 0x00000080 /* The scheme is explicitly specified */ +#define HTX_SL_F_SCHM_HTTP 0x00000100 /* The scheme HTTP should be used */ +#define HTX_SL_F_SCHM_HTTPS 0x00000200 /* The scheme HTTPS should be used */ +#define HTX_SL_F_HAS_AUTHORITY 0x00000400 /* The request authority is explicitly specified */ +#define HTX_SL_F_NORMALIZED_URI 0x00000800 /* The received URI is normalized (an implicit absolute-uri form) */ + /* HTX flags */ #define HTX_FL_NONE 0x00000000