mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-16 00:14:31 +00:00
MINOR: h1: report in the h1m struct if the HTTP version is 1.1 or above
This will be needed for the mux to know how to process the Connection header, and will save it from having to re-parse the request line since it's captured on the fly.
This commit is contained in:
parent
db72da0432
commit
ba5fbca33f
@ -140,6 +140,7 @@ enum h1m_state {
|
||||
#define H1_MF_CHNK 0x00000002 // chunk present, exclusive with c-l
|
||||
#define H1_MF_RESP 0x00000004 // this message is the response message
|
||||
#define H1_MF_TOLOWER 0x00000008 // turn the header names to lower case
|
||||
#define H1_MF_VER_11 0x00000010 // message indicates version 1.1 or above
|
||||
|
||||
|
||||
/* basic HTTP/1 message state for use in parsers. The err_pos field is special,
|
||||
|
11
src/h1.c
11
src/h1.c
@ -896,6 +896,11 @@ int h1_headers_to_hdr_list(char *start, const char *stop,
|
||||
*/
|
||||
|
||||
if (likely(!skip_update)) {
|
||||
if ((sl.rq.v_l == 8) &&
|
||||
((start[sl.rq.v + 5] > '1') ||
|
||||
((start[sl.rq.v + 5] == '1') && (start[sl.rq.v + 7] >= '1'))))
|
||||
h1m->flags |= H1_MF_VER_11;
|
||||
|
||||
if (unlikely(hdr_count >= hdr_num)) {
|
||||
state = H1_MSG_RQVER;
|
||||
goto http_output_full;
|
||||
@ -979,6 +984,12 @@ int h1_headers_to_hdr_list(char *start, const char *stop,
|
||||
|
||||
if (likely(HTTP_IS_SPHT(*ptr))) {
|
||||
sl.st.v_l = ptr - start;
|
||||
|
||||
if ((sl.st.v_l == 8) &&
|
||||
((start[sl.st.v + 5] > '1') ||
|
||||
((start[sl.st.v + 5] == '1') && (start[sl.st.v + 7] >= '1'))))
|
||||
h1m->flags |= H1_MF_VER_11;
|
||||
|
||||
EAT_AND_JUMP_OR_RETURN(ptr, end, http_msg_rpver_sp, http_msg_ood, state, H1_MSG_RPVER_SP);
|
||||
}
|
||||
state = H1_MSG_RPVER;
|
||||
|
Loading…
Reference in New Issue
Block a user