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.
This commit is contained in:
Christopher Faulet 2021-01-21 17:31:04 +01:00
parent da46a0dca7
commit cdd1e2a44b

View File

@ -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) {