mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-31 10:31:46 +00:00
BUG/MINOR: stream: Properly handle TCP>H1>H2 upgrades in http_wait_for_request
When a TCP stream is first upgraded to H1 and then to H2, we must be sure to inhibit any connect and to properly handle the TCP stream destruction. When the TCP stream is upgraded to H1, the HTTP analysers are set. Thus http_wait_for_request() is called. In this case, the server connection must be blocked, waiting for the request analysis. Otherwise, a server may be assigned to the stream too early. It is especially a problem if the stream is finally destroyed because of an implicit upgrade to H2. In this case, the stream processing must be properly aborted to not have a stalled stream. Thus, if a shutdown is detected in http_wait_for_request() when an HTTP upgrade is performed, the stream is aborted. It is a 2.4-specific bug. No backport is needed.
This commit is contained in:
parent
57e4a1bf44
commit
97b3a61449
@ -101,6 +101,22 @@ int http_wait_for_request(struct stream *s, struct channel *req, int an_bit)
|
||||
*/
|
||||
BUG_ON(!(s->flags & SF_IGNORE) || !c_empty(&s->req));
|
||||
|
||||
/* Don't connect for now */
|
||||
channel_dont_connect(req);
|
||||
|
||||
/* A SHUTR at this stage means we are performing a "destructive"
|
||||
* HTTP upgrade (TCP>H2). In this case, we can leave.
|
||||
*/
|
||||
if (req->flags & CF_SHUTR) {
|
||||
s->logs.logwait = 0;
|
||||
s->logs.level = 0;
|
||||
channel_abort(&s->req);
|
||||
channel_abort(&s->res);
|
||||
req->analysers &= AN_REQ_FLT_END;
|
||||
req->analyse_exp = TICK_ETERNITY;
|
||||
DBG_TRACE_LEAVE(STRM_EV_STRM_ANA, s);
|
||||
return 1;
|
||||
}
|
||||
DBG_TRACE_LEAVE(STRM_EV_STRM_ANA, s);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user