You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.3 KiB

  1. commit 074230876d05bdf3fe33893889b326da14ab8ae9
  2. Author: Christopher Faulet <cfaulet@haproxy.com>
  3. Date: Thu Oct 24 10:31:01 2019 +0200
  4. BUG/MINOR: mux-h2: Don't pretend mux buffers aren't full anymore if nothing sent
  5. In h2_send(), when something is sent, we remove the flags
  6. (H2_CF_MUX_MFULL|H2_CF_DEM_MROOM) on the h2 connection. This way, we are able to
  7. wake up all streams waiting to send data. Unfortunatly, these flags are
  8. unconditionally removed, even when nothing was sent. So if the h2c is blocked
  9. because the mux buffers are full and we are unable to send anything, all streams
  10. in the send_list are woken up for nothing. Now, we only remove these flags if at
  11. least a send succeeds.
  12. This patch must be backport to 2.0.
  13. (cherry picked from commit 69fe5cea213afd0c7465094e9dfead93143dcf3f)
  14. Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
  15. diff --git a/src/mux_h2.c b/src/mux_h2.c
  16. index afa68e80..ac34a723 100644
  17. --- a/src/mux_h2.c
  18. +++ b/src/mux_h2.c
  19. @@ -2943,7 +2943,8 @@ static int h2_send(struct h2c *h2c)
  20. offer_buffers(NULL, tasks_run_queue);
  21. /* wrote at least one byte, the buffer is not full anymore */
  22. - h2c->flags &= ~(H2_CF_MUX_MFULL | H2_CF_DEM_MROOM);
  23. + if (sent)
  24. + h2c->flags &= ~(H2_CF_MUX_MFULL | H2_CF_DEM_MROOM);
  25. }
  26. if (conn->flags & CO_FL_SOCK_WR_SH) {