MINOR: h1: Add a H1M flag to specify a non-empty 'Upgrade:' header was parsed

H1_MF_UPG_HDR flags was introduced to let H1 parser knwon a non-empty 'Upgrade:'
header was parsed.

This patch is mandatory to fix a bug.
This commit is contained in:
Christopher Faulet 2026-05-26 15:30:33 +02:00
parent 547c2e4e78
commit b238c08015
2 changed files with 4 additions and 1 deletions

View file

@ -98,7 +98,7 @@ enum h1m_state {
#define H1_MF_UPG_WEBSOCKET 0x00008000 // Set for a Websocket upgrade handshake
#define H1_MF_TE_CHUNKED 0x00010000 // T-E "chunked"
#define H1_MF_TE_OTHER 0x00020000 // T-E other than supported ones found (only "chunked" is supported for now)
/* unused: 0x00040000 */
#define H1_MF_UPG_HDR 0x00040000 // non-empty Upgrapde header found
#define H1_MF_NOT_HTTP 0x00080000 // Not an HTTP message (e.g "RTSP", only possible if invalid message are accepted)
/* Mask to use to reset H1M flags when we restart headers parsing.
*

View file

@ -316,6 +316,9 @@ void h1_parse_upgrade_header(struct h1m *h1m, struct ist *value)
skip_val:
word.ptr = p = n;
}
if (istlen(*value))
h1m->flags |= H1_MF_UPG_HDR;
}
/* Macros used in the HTTP/1 parser, to check for the expected presence of