]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: http: Return an error in proxy mode when url2sa fails
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 13 Apr 2018 13:53:12 +0000 (15:53 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 16 Apr 2018 13:31:18 +0000 (15:31 +0200)
commit11ebb2080eb0394f0a1c2fc70f44da2b0107bb56
treed1f7bd173fd5b4e692d5f303543d6c5ba3b5c37e
parent302f9ef0556b6795bda8882edf56611ee252fceb
BUG/MINOR: http: Return an error in proxy mode when url2sa fails

In proxy mode, the result of url2sa is never checked. So when the function fails
to resolve the destination server from the URL, we continue. Depending on the
internal state of the connection, we get different behaviours. With a newly
allocated connection, the field <addr.to> is not set. So we will get a HTTP
error. The status code is 503 instead of 400, but it's not really critical. But,
if it's a recycled connection, we will reuse the previous value of <addr.to>,
opening a connection on an unexpected server.

To fix the bug, we return an error when url2sa fails.

This patch should be backported in all version from 1.5.
src/proto_http.c