]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mux-h1: Set CS_FL_EOI the end of the message is reached
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 22 Mar 2019 13:09:41 +0000 (14:09 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 25 Mar 2019 05:33:53 +0000 (06:33 +0100)
As for the H2 multiplexer, When the end of a message is detected, the flag
CS_FL_EOI is set on the conn_stream.

This patch should be backported to 1.9.

src/mux_h1.c

index 8b686fe25f93ef3f107fa5ff009df4309ee68b86..b191670250c3a9ce7677acbb800ccb6f5a7baeb6 100644 (file)
@@ -1033,9 +1033,11 @@ static size_t h1_process_headers(struct h1s *h1s, struct h1m *h1m, struct htx *h
                sl->info.res.status = h1s->status;
        }
 
-       if (h1m->state == H1_MSG_DONE)
+       if (h1m->state == H1_MSG_DONE) {
                if (!htx_add_endof(htx, HTX_BLK_EOM))
                        goto error;
+               h1s->cs->flags |= CS_FL_EOI;
+       }
 
        h1_process_conn_mode(h1s, h1m, htx, NULL);
 
@@ -1130,6 +1132,7 @@ static size_t h1_process_data(struct h1s *h1s, struct h1m *h1m, struct htx *htx,
                                if (!htx_add_endof(htx, HTX_BLK_EOM))
                                        goto end;
                                h1m->state = H1_MSG_DONE;
+                               h1s->cs->flags |= CS_FL_EOI;
                        }
                }
                else if (h1m->flags & H1_MF_CHNK) {
@@ -1228,6 +1231,7 @@ static size_t h1_process_data(struct h1s *h1s, struct h1m *h1m, struct htx *htx,
                                if (!htx_add_endof(htx, HTX_BLK_EOM))
                                        goto end;
                                h1m->state = H1_MSG_DONE;
+                               h1s->cs->flags |= CS_FL_EOI;
                        }
                }
                else {
@@ -1237,6 +1241,7 @@ static size_t h1_process_data(struct h1s *h1s, struct h1m *h1m, struct htx *htx,
                        if (!htx_add_endof(htx, HTX_BLK_EOM))
                                goto end;
                        h1m->state = H1_MSG_DONE;
+                       h1s->cs->flags |= CS_FL_EOI;
                }
        }
        else {