From: Willy Tarreau Date: Tue, 11 Sep 2018 17:23:04 +0000 (+0200) Subject: MINOR: h1: remove the HTTP status from the H1M struct X-Git-Tag: v1.9-dev2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=11da5674c36b0ebc72b8b6a54f74ad8f0ad078c1;p=thirdparty%2Fhaproxy.git MINOR: h1: remove the HTTP status from the H1M struct It has nothing to do there and is not used from there anymore, let's get rid of it. --- diff --git a/include/proto/h1.h b/include/proto/h1.h index fb040d1388..51e8834200 100644 --- a/include/proto/h1.h +++ b/include/proto/h1.h @@ -304,7 +304,6 @@ static inline struct h1m *h1m_init_req(struct h1m *h1m) { h1m->state = H1_MSG_RQBEFORE; h1m->next = 0; - h1m->status = 0; h1m->flags = H1_MF_NONE; h1m->curr_len = 0; h1m->body_len = 0; @@ -318,7 +317,6 @@ static inline struct h1m *h1m_init_res(struct h1m *h1m) { h1m->state = H1_MSG_RPBEFORE; h1m->next = 0; - h1m->status = 0; h1m->flags = H1_MF_RESP; h1m->curr_len = 0; h1m->body_len = 0; diff --git a/include/types/h1.h b/include/types/h1.h index 26eafd3397..ec8cca0e20 100644 --- a/include/types/h1.h +++ b/include/types/h1.h @@ -149,8 +149,7 @@ enum h1m_state { */ struct h1m { enum h1m_state state; // H1 message state (H1_MSG_*) - /* 8 bits available here */ - uint16_t status; // HTTP status code + /* 24 bits available here */ uint32_t flags; // H1 message flags (H1_MF_*) uint64_t curr_len; // content-length or last chunk length uint64_t body_len; // total known size of the body length diff --git a/src/h1.c b/src/h1.c index fc0b8da58b..1172e05c8f 100644 --- a/src/h1.c +++ b/src/h1.c @@ -859,8 +859,6 @@ int h1_headers_to_hdr_list(char *start, const char *stop, } http_set_hdr(&hdr[hdr_count++], ist(":status"), ist2(start + sl.st.c, sl.st.c_l)); } - if (h1m) - h1m->status = sl.st.status; sol = ptr - start; if (likely(*ptr == '\r')) @@ -1032,9 +1030,9 @@ int h1_headers_to_hdr_list(char *start, const char *stop, http_set_hdr(&hdr[hdr_count++], n, v); - if (h1m->status >= 100 && h1m->status < 200) + if (sl.st.status >= 100 && sl.st.status < 200) h1m->curr_len = h1m->body_len = 0; - else if (h1m->status == 304 || h1m->status == 204) { + else if (sl.st.status == 304 || sl.st.status == 204) { /* no contents, claim c-len is present and set to zero */ h1m->flags |= H1_MF_CLEN; h1m->curr_len = h1m->body_len = 0;