acpid: update to 2.0.28
[feed/packages.git] / net / haproxy / patches / 0012-MINOR-http-Reorder-rewrite-checks-in-http_resync_sta.patch
1 From a49007a187ab7fddfcec58e1d9fc8a707e4531c9 Mon Sep 17 00:00:00 2001
2 From: Christopher Faulet <cfaulet@haproxy.com>
3 Date: Tue, 18 Jul 2017 11:18:46 +0200
4 Subject: [PATCH 12/18] MINOR: http: Reorder/rewrite checks in
5 http_resync_states
6
7 The previous patch removed the forced symmetry of the TUNNEL mode during the
8 state synchronization. Here, we take care to remove body analyzer only on the
9 channel in TUNNEL mode. In fact, today, this change has no effect because both
10 sides are switched in same time. But this way, with some changes, it will be
11 possible to keep body analyzer on a side (to finish the states synchronization)
12 with the other one in TUNNEL mode.
13
14 WARNING: This patch will be used to fix a bug. The fix will be commited in a
15 very next commit. So if the fix is backported, this one must be backported too.
16
17 (cherry picked from commit f77bb539d4846ab278269b99a3165a5608ca0cf4)
18 Signed-off-by: William Lallemand <wlallemand@haproxy.org>
19 ---
20 src/proto_http.c | 48 +++++++++++++++++++++++++++++-------------------
21 1 file changed, 29 insertions(+), 19 deletions(-)
22
23 diff --git a/src/proto_http.c b/src/proto_http.c
24 index 796955f5..aaf9f648 100644
25 --- a/src/proto_http.c
26 +++ b/src/proto_http.c
27 @@ -5577,34 +5577,27 @@ int http_resync_states(struct stream *s)
28
29 /* OK, both state machines agree on a compatible state.
30 * There are a few cases we're interested in :
31 - * - HTTP_MSG_TUNNEL on either means we have to disable both analysers
32 * - HTTP_MSG_CLOSED on both sides means we've reached the end in both
33 * directions, so let's simply disable both analysers.
34 - * - HTTP_MSG_CLOSED on the response only means we must abort the
35 - * request.
36 - * - HTTP_MSG_CLOSED on the request and HTTP_MSG_DONE on the response
37 - * with server-close mode means we've completed one request and we
38 - * must re-initialize the server connection.
39 + * - HTTP_MSG_CLOSED on the response only or HTTP_MSG_ERROR on either
40 + * means we must abort the request.
41 + * - HTTP_MSG_TUNNEL on either means we have to disable analyser on
42 + * corresponding channel.
43 + * - HTTP_MSG_DONE or HTTP_MSG_CLOSED on the request and HTTP_MSG_DONE
44 + * on the response with server-close mode means we've completed one
45 + * request and we must re-initialize the server connection.
46 */
47 -
48 - if (txn->req.msg_state == HTTP_MSG_TUNNEL ||
49 - txn->rsp.msg_state == HTTP_MSG_TUNNEL ||
50 - (txn->req.msg_state == HTTP_MSG_CLOSED &&
51 - txn->rsp.msg_state == HTTP_MSG_CLOSED)) {
52 + if (txn->req.msg_state == HTTP_MSG_CLOSED &&
53 + txn->rsp.msg_state == HTTP_MSG_CLOSED) {
54 s->req.analysers &= AN_REQ_FLT_END;
55 channel_auto_close(&s->req);
56 channel_auto_read(&s->req);
57 s->res.analysers &= AN_RES_FLT_END;
58 channel_auto_close(&s->res);
59 channel_auto_read(&s->res);
60 - if (txn->req.msg_state == HTTP_MSG_TUNNEL && HAS_REQ_DATA_FILTERS(s))
61 - s->req.analysers |= AN_REQ_FLT_XFER_DATA;
62 - if (txn->rsp.msg_state == HTTP_MSG_TUNNEL && HAS_RSP_DATA_FILTERS(s))
63 - s->res.analysers |= AN_RES_FLT_XFER_DATA;
64 - }
65 - else if ((txn->req.msg_state >= HTTP_MSG_DONE &&
66 - (txn->rsp.msg_state == HTTP_MSG_CLOSED || (s->res.flags & CF_SHUTW))) ||
67 - txn->rsp.msg_state == HTTP_MSG_ERROR ||
68 + }
69 + else if (txn->rsp.msg_state == HTTP_MSG_CLOSED ||
70 + txn->rsp.msg_state == HTTP_MSG_ERROR ||
71 txn->req.msg_state == HTTP_MSG_ERROR) {
72 s->res.analysers &= AN_RES_FLT_END;
73 channel_auto_close(&s->res);
74 @@ -5615,6 +5608,23 @@ int http_resync_states(struct stream *s)
75 channel_auto_read(&s->req);
76 channel_truncate(&s->req);
77 }
78 + else if (txn->req.msg_state == HTTP_MSG_TUNNEL ||
79 + txn->rsp.msg_state == HTTP_MSG_TUNNEL) {
80 + if (txn->req.msg_state == HTTP_MSG_TUNNEL) {
81 + s->req.analysers &= AN_REQ_FLT_END;
82 + if (HAS_REQ_DATA_FILTERS(s))
83 + s->req.analysers |= AN_REQ_FLT_XFER_DATA;
84 + }
85 + if (txn->rsp.msg_state == HTTP_MSG_TUNNEL) {
86 + s->res.analysers &= AN_RES_FLT_END;
87 + if (HAS_RSP_DATA_FILTERS(s))
88 + s->res.analysers |= AN_RES_FLT_XFER_DATA;
89 + }
90 + channel_auto_close(&s->req);
91 + channel_auto_read(&s->req);
92 + channel_auto_close(&s->res);
93 + channel_auto_read(&s->res);
94 + }
95 else if ((txn->req.msg_state == HTTP_MSG_DONE ||
96 txn->req.msg_state == HTTP_MSG_CLOSED) &&
97 txn->rsp.msg_state == HTTP_MSG_DONE &&
98 --
99 2.13.0
100