BUG/MEDIUM: http: Close streams for connections closed before a redirect
A previous fix was made to prevent the connection to a server if a redirect was performed during the request processing when we wait to keep the client connection alive. This fix introduced a pernicious bug. If a client closes its connection immediately after sending a request, it is possible to keep stream alive infinitely. This happens when the connection closure is caught when the request is received, before the request parsing. To be more specific, this happens because the close event is not "forwarded", first because of the call to "channel_dont_connect" in the function "http_apply_redirect_rule", then because we want to keep the client connection alive, we explicitly call "channel_dont_close" in the function "http_request_forward_body". So, to fix the bug, instead of blocking the server connection, we force its shutdown. This will force the stream to re-evaluate all connexions states. So it will detect the client has closed its connection. This patch must be backported in 1.7.
This commit is contained in:
parent
ddcde195eb
commit
5d468ca97b
@ -4237,8 +4237,8 @@ static int http_apply_redirect_rule(struct redirect_rule *rule, struct stream *s
|
||||
/* Trim any possible response */
|
||||
res->chn->buf->i = 0;
|
||||
res->next = res->sov = 0;
|
||||
/* If not already done, don't perform any connection establishment */
|
||||
channel_dont_connect(req->chn);
|
||||
/* let the server side turn to SI_ST_CLO */
|
||||
channel_shutw_now(req->chn);
|
||||
} else {
|
||||
/* keep-alive not possible */
|
||||
if (unlikely(txn->flags & TX_USE_PX_CONN)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user