]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: h2: don't try (and fail) to send non-existing data in the mux
authorWilly Tarreau <w@1wt.eu>
Tue, 7 Nov 2017 10:03:56 +0000 (11:03 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 7 Nov 2017 10:03:56 +0000 (11:03 +0100)
The call to xprt->snd_buf() was not conditionned on the presence of
data in the buffer, resulting in snd_buf() returning 0 and never
disabling the polling. It was revealed by the previous bug on error
processing but must properly be handled.

src/mux_h2.c

index aea1f98d8bfcdb4367621902b7473cc226c983ee..789f8eaeb3c6e6f40b7003900ec020214837d317 100644 (file)
@@ -1987,7 +1987,7 @@ static void h2_send(struct connection *conn)
                if (h2c->flags & (H2_CF_MUX_MFULL | H2_CF_DEM_MBUSY | H2_CF_DEM_MROOM))
                        flags |= CO_SFL_MSG_MORE;
 
-               if (conn->xprt->snd_buf(conn, h2c->mbuf, flags) <= 0)
+               if (h2c->mbuf->o && conn->xprt->snd_buf(conn, h2c->mbuf, flags) <= 0)
                        break;
 
                /* wrote at least one byte, the buffer is not full anymore */