]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: session: do not report a failure when rejecting a session
authorWilly Tarreau <w@1wt.eu>
Tue, 7 Jan 2020 17:03:09 +0000 (18:03 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 7 Jan 2020 17:15:32 +0000 (18:15 +0100)
commite5891ca6c14c46d5f3a2169ede75b7fbb225216f
treee1b5c8c1253ca7208cfb51305ad3dd8c2e29d722
parent584348be636fcc9f41b80ef0fde03c7899d75cd7
BUG/MEDIUM: session: do not report a failure when rejecting a session

In session_accept_fd() we can perform a synchronous call to
conn_complete_session() and if it succeeds the connection is accepted
and turned into a session. If it fails we take it as an error while it
is not, in this case, it's just that a tcp-request rule has decided to
reject the incoming connection. The problem with reporting such an event
as an error is that the failed status is passed down to the listener code
which decides to disable accept() for 100ms in order to leave some time
for transient issues to vanish, and that's not what we want to do here.

This fix must be backported as far as 1.7. In 1.7 the code is a bit
different as tcp_exec_l5_rules() is called directly from within
session_new_fd() and ret=0 must be assigned there.
src/session.c