CLEANUP: connection: do not use conn->owner when the session is known
authorWilly Tarreau <w@1wt.eu>
Fri, 20 Nov 2020 16:08:15 +0000 (17:08 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 24 Nov 2020 13:42:07 +0000 (14:42 +0100)
commit4d41466b95b9a1e4c9e396a1ab2a6c83fd51c8b4
treecd98d5f197d6f9973285bc4254f147792b85676e
parentcaaa46c2edbefd9b59a2ecfe962cf36e5da4c790
CLEANUP: connection: do not use conn->owner when the session is known

At a few places we used to rely on conn->owner to retrieve the session
while the session is already known. This is not correct because at some
of these points the reason the connection's owner was still the session
(instead of NULL) is a mistake. At one place a comparison is even made
between the session and conn->owner assuming it's valid without checking
if it's NULL. Let's clean this up to use the session all the time.

Note that this will be needed for a forthcoming fix and will have to be
backported.

(cherry picked from commit 38b4d2eb22fec0f11af50f8a9977ccae0e7c66c6)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
include/haproxy/session.h
src/backend.c
src/connection.c