]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: connection: don't store recv() result into trash.data
authorWilly Tarreau <w@1wt.eu>
Wed, 22 Aug 2018 03:20:32 +0000 (05:20 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 22 Aug 2018 03:28:32 +0000 (05:28 +0200)
commitb406b8708fef5ff51e684794b5df4fea728b0058
tree686b5609f484c1d15d2517159f83a5b0b31f8620
parent2842e05c7c9d9fb7e03f8900f778dc4fae4deb78
BUG/MEDIUM: connection: don't store recv() result into trash.data

Cyril Bonté discovered that the proxy protocol randomly fails since
commit 843b7cb ("MEDIUM: chunks: make the chunk struct's fields match
the buffer struct"). This is because we used to store recv()'s return
code into trash.data which is now unsigned, so it never compares as
negative against 0. Let's clean this up and test the result itself
without storing it first.

No backport is needed.
src/connection.c