]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: h1: remove the HTTP status from the H1M struct
authorWilly Tarreau <w@1wt.eu>
Tue, 11 Sep 2018 17:23:04 +0000 (19:23 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 12 Sep 2018 15:38:25 +0000 (17:38 +0200)
It has nothing to do there and is not used from there anymore, let's
get rid of it.

include/proto/h1.h
include/types/h1.h
src/h1.c

index fb040d1388268cddb86be0f0812c6c7c2d4b5e12..51e8834200d378109b9ba025543d0db0db201333 100644 (file)
@@ -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;
index 26eafd3397db1c12e7b238f1e7968ebe9c2da83f..ec8cca0e207e3d9af7f9fe62265bcc2114507713 100644 (file)
@@ -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
index fc0b8da58b84ad868024d206867e230ed91de751..1172e05c8f49940a18b1fd778467c2c87f3a6932 100644 (file)
--- 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;