mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-13 15:04:42 +00:00
MINOR: h1: properly pre-initialize err_pos to -2
This way we maintain the old mechanism stating that -2 means we block on errors, -1 means we only capture them, and a positive value indicates the position of the first error.
This commit is contained in:
parent
25173a7bcc
commit
bbf3823f82
@ -309,7 +309,7 @@ static inline struct h1m *h1m_init_req(struct h1m *h1m)
|
|||||||
h1m->flags = H1_MF_NONE;
|
h1m->flags = H1_MF_NONE;
|
||||||
h1m->curr_len = 0;
|
h1m->curr_len = 0;
|
||||||
h1m->body_len = 0;
|
h1m->body_len = 0;
|
||||||
h1m->err_pos = 0;
|
h1m->err_pos = -2;
|
||||||
h1m->err_state = 0;
|
h1m->err_state = 0;
|
||||||
return h1m;
|
return h1m;
|
||||||
}
|
}
|
||||||
@ -323,7 +323,7 @@ static inline struct h1m *h1m_init_res(struct h1m *h1m)
|
|||||||
h1m->flags = H1_MF_RESP;
|
h1m->flags = H1_MF_RESP;
|
||||||
h1m->curr_len = 0;
|
h1m->curr_len = 0;
|
||||||
h1m->body_len = 0;
|
h1m->body_len = 0;
|
||||||
h1m->err_pos = 0;
|
h1m->err_pos = -2;
|
||||||
h1m->err_state = 0;
|
h1m->err_state = 0;
|
||||||
return h1m;
|
return h1m;
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,12 @@ enum h1m_state {
|
|||||||
#define H1_MF_RESP 0x00000004 // this message is the response message
|
#define H1_MF_RESP 0x00000004 // this message is the response message
|
||||||
|
|
||||||
|
|
||||||
/* basic HTTP/1 message state for use in parsers */
|
/* basic HTTP/1 message state for use in parsers. The err_pos field is special,
|
||||||
|
* it is pre-set to a negative value (-1 or -2), and once non-negative it contains
|
||||||
|
* the relative position in the message of the first parse error. -2 is used to tell
|
||||||
|
* the parser that we want to block the invalid message. -1 is used to only perform
|
||||||
|
* a silent capture.
|
||||||
|
*/
|
||||||
struct h1m {
|
struct h1m {
|
||||||
enum h1m_state state; // H1 message state (H1_MSG_*)
|
enum h1m_state state; // H1 message state (H1_MSG_*)
|
||||||
/* 8 bits available here */
|
/* 8 bits available here */
|
||||||
|
Loading…
Reference in New Issue
Block a user