summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faulet <cfaulet@haproxy.com>2021-01-21 17:31:04 +0100
committerChristopher Faulet <cfaulet@haproxy.com>2021-01-26 15:00:18 +0100
commit5d47ef87e56d7e88f976ccd9d97e4b6ebd72df08 (patch)
tree5cf1d9f04b293803259c83b952b866d8bf9ff96a
parentff4dc825fe7528ae0387509626eb0e7b414badb4 (diff)
downloadhaproxy-5d47ef87e56d7e88f976ccd9d97e4b6ebd72df08.tar.gz
BUG/MEDIUM: stream: Don't immediatly ack the TCP to H1 upgrades
Instead of switching the stream to HTX mode, the request channel is only reset (the request buffer is xferred to the mux) and the SF_IGNORE flag is set on the stream. This flag prevent any processing in case of abort. Once the upgrade confirmed, the flag is removed, in stream_upgrade_from_cs(). It is only the first part of the fix. The next one ("BUG/MAJOR: mux-h1: Properly handle TCP to H1 upgrades") is also required. Both rely on the following series of patches : * MEDIUM: http-ana: Do nothing in wait-for-request analyzer if not htx * MINOR: stream: Add a function to validate TCP to H1 upgrades * MEDIUM: mux-h1: Add ST_READY state for the H1 connections * MINOR: mux-h1: Wake up instead of subscribe for reads after H1C creation * MINOR: mux-h1: Try to wake up data layer first before calling its wake callback * MINOR: stream-int: Take care of EOS in the SI wake callback function * BUG/MINOR: stream: Don't update counters when TCP to H2 upgrades are performed This fix is specific for 2.4. No backport needed.
-rw-r--r--src/proxy.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/proxy.c b/src/proxy.c
index 8b2cf4f14..0b1909974 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -1457,7 +1457,9 @@ int stream_set_backend(struct stream *s, struct proxy *be)
s->flags |= SF_IGNORE;
return 0;
}
- s->flags |= SF_HTX;
+ s->req.flags &= ~(CF_READ_PARTIAL|CF_AUTO_CONNECT);
+ s->req.total = 0;
+ s->flags |= SF_IGNORE;
}
}
else if (IS_HTX_STRM(s) && be->mode != PR_MODE_HTTP) {