]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: streams: Don't use CF_EOI to decide if the request is complete.
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 17 May 2019 13:38:29 +0000 (15:38 +0200)
committerOlivier Houchard <cognet@ci0.org>
Fri, 17 May 2019 13:49:21 +0000 (15:49 +0200)
In si_cs_send(), don't check CF_EOI on the request channel to decide if the
request is complete and if we should save the buffer to eventually attempt
L7 retries. The flag may not be set yet, and it may too be set to early,
before we're done modifying the buffer. Instead, get the msg, and make sure
its state is HTTP_MSG_DONE.
That way we will store the request buffer when sending it even in H2.

src/stream_interface.c

index 731df38a5d60a6d641dfcd1d2477ecf34df00d66..3b9c70777017e0c8a5650ea1154ebbf7298a72c4 100644 (file)
@@ -688,6 +688,7 @@ int si_cs_send(struct conn_stream *cs)
                        send_flag |= CO_SFL_STREAMER;
 
                if ((si->flags & SI_FL_L7_RETRY) && !b_data(&si->l7_buffer)) {
+                       struct stream *s = si_strm(si);
                        /* If we want to be able to do L7 retries, copy
                         * the data we're about to send, so that we are able
                         * to resend them if needed
@@ -697,7 +698,7 @@ int si_cs_send(struct conn_stream *cs)
                         * disable the l7 retries by setting
                         * l7_conn_retries to 0.
                         */
-                       if (!(oc->flags & CF_EOI))
+                       if (!s->txn || (s->txn->req.msg_state != HTTP_MSG_DONE))
                                si->flags &= ~SI_FL_L7_RETRY;
                        else {
                                if (b_is_null(&si->l7_buffer))