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.

43 lines
1.7 KiB

  1. commit cfdef9f428869f1570d51a5bd8975d8a42f31eab
  2. Author: Christopher Faulet <cfaulet@haproxy.com>
  3. Date: Mon Sep 23 15:57:29 2019 +0200
  4. BUG/MINOR: stream-int: Process connection/CS errors first in si_cs_send()
  5. Errors on the connections or the conn-stream must always be processed in
  6. si_cs_send(), even if the stream-interface is already subscribed on
  7. sending. This patch does not fix any concrete bug per-se. But it is required by
  8. the following one to handle those errors during synchronous sends.
  9. This patch must be backported with the following one to 2.0 and probably to 1.9
  10. too, but with caution because the code is really different.
  11. (cherry picked from commit 328ed220a8c5211aa8b6f37b982f319cf6b3f3d1)
  12. Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
  13. diff --git a/src/stream_interface.c b/src/stream_interface.c
  14. index 7d89cc90..4130444e 100644
  15. --- a/src/stream_interface.c
  16. +++ b/src/stream_interface.c
  17. @@ -652,10 +652,6 @@ int si_cs_send(struct conn_stream *cs)
  18. int ret;
  19. int did_send = 0;
  20. - /* We're already waiting to be able to send, give up */
  21. - if (si->wait_event.events & SUB_RETRY_SEND)
  22. - return 0;
  23. -
  24. if (conn->flags & CO_FL_ERROR || cs->flags & (CS_FL_ERROR|CS_FL_ERR_PENDING)) {
  25. /* We're probably there because the tasklet was woken up,
  26. * but process_stream() ran before, detected there were an
  27. @@ -669,6 +665,10 @@ int si_cs_send(struct conn_stream *cs)
  28. return 1;
  29. }
  30. + /* We're already waiting to be able to send, give up */
  31. + if (si->wait_event.events & SUB_RETRY_SEND)
  32. + return 0;
  33. +
  34. /* we might have been called just after an asynchronous shutw */
  35. if (conn->flags & CO_FL_SOCK_WR_SH || oc->flags & CF_SHUTW)
  36. return 1;