mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-05 22:56:57 +02:00
BUG/MEDIUM: mux-h1: Properly close H1C if an error is reported before sending data
It is possible to have front H1 connections waiting for the client timeout while they should be closed because a conneciton error was reported before sebding an error message to the client. It is not a leak because the connections are closed when the timeout expires but it is a waste of ressources, especially if the client timeout is high. When an early error message must be sent to the client, if an error was already detected, no data are sent and the output buffer is released. At this stage, the H1 connection is in CLOSING state and it must be released. But because of a bug, this is not performed. The client timeout is rearmed and the H1 connection is only closed when it expires. To fix the issue, the condition to close a H1C must also be evaluated when an error is detected before sending data. It is only an issue with idle client connections, because there is no H1 stream in that case and the error message is generated by the mux itself. This patch must be backported as far as 2.8.
This commit is contained in:
parent
1f099db7e2
commit
b18e988e0d
@ -3912,7 +3912,7 @@ static int h1_send(struct h1c *h1c)
|
||||
b_reset(&h1c->obuf);
|
||||
if (h1c->flags & H1C_F_EOS)
|
||||
h1c->flags |= H1C_F_ERROR;
|
||||
return 1;
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (!b_data(&h1c->obuf))
|
||||
|
Loading…
Reference in New Issue
Block a user