fwknop: init script improvements
[feed/packages.git] / net / haproxy / patches / 018-BUG-MEDIUM-mux_h1-Dont-call-h1_send-if-we-subscribed.patch
1 commit da6d362ab057217dfdd61a581c6596af4d0ac767
2 Author: Olivier Houchard <cognet@ci0.org>
3 Date: Wed Jan 15 19:13:32 2020 +0100
4
5 BUG/MEDIUM: mux_h1: Don't call h1_send if we subscribed().
6
7 In h1_snd_buf(), only attempt to call h1_send() if we haven't
8 already subscribed.
9 It makes no sense to do it if we subscribed, as we know we failed
10 to send before, and will create a useless call to sendto(), and
11 in 2.2, the call to raw_sock_from_buf() will disable polling if
12 it is enabled.
13
14 This should be backported to 2.2, 2.1, 2.0 and 1.9.
15
16 (cherry picked from commit 68787ef70a2e0fe19d0ab753dab8ed5c90cb4398)
17 Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
18
19 diff --git a/src/mux_h1.c b/src/mux_h1.c
20 index b44204845..d93a7eab5 100644
21 --- a/src/mux_h1.c
22 +++ b/src/mux_h1.c
23 @@ -2670,7 +2670,7 @@ static size_t h1_snd_buf(struct conn_stream *cs, struct buffer *buf, size_t coun
24 break;
25 total += ret;
26 count -= ret;
27 - if (!h1_send(h1c))
28 + if ((h1c->wait_event.events & SUB_RETRY_SEND) || !h1_send(h1c))
29 break;
30 }
31