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