]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h1: Don't count the EOM in the estimated size of headers
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 24 May 2019 19:43:55 +0000 (21:43 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 5 Jun 2019 08:12:11 +0000 (10:12 +0200)
If there is not enough space in the HTX message, the EOM can be delayed when a
bodyless message is added. So, don't count it in the estimated size of headers.

src/mux_h1.c

index e89dfd3e22c82f65b89b705501a7d26a58e3cc15..c5fdb7df1273dad6a55f2d537f9453361496c0e1 100644 (file)
@@ -920,11 +920,6 @@ static size_t h1_eval_htx_req_size(struct h1m *h1m, union h1_sl *h1sl, struct ht
        /* size of the HTX start-line */
        sz = sizeof(struct htx_sl) + h1sl->rq.m.len + h1sl->rq.u.len + h1sl->rq.v.len;
        sz += h1_eval_htx_hdrs_size(hdrs);
-
-       /* size of the EOM */
-       if (h1m->state == H1_MSG_DONE)
-               sz += sizeof(struct htx_blk) + 1;
-
        return sz;
 }
 
@@ -936,11 +931,6 @@ static size_t h1_eval_htx_res_size(struct h1m *h1m, union h1_sl *h1sl, struct ht
        /* size of the HTX start-line */
        sz = sizeof(struct htx_sl) + h1sl->st.v.len + h1sl->st.c.len + h1sl->st.r.len;
        sz += h1_eval_htx_hdrs_size(hdrs);
-
-       /* size of the EOM */
-       if (h1m->state == H1_MSG_DONE)
-               sz += sizeof(struct htx_blk) + 1;
-
        return sz;
 }