]> git.ipfire.org Git - thirdparty/haproxy.git/commit
OPTIM/MINOR: session: abort if possible before connecting to the backend
authorFrederik Deweerdt <fdeweerdt@fastly.com>
Thu, 7 Apr 2016 16:01:04 +0000 (09:01 -0700)
committerWilly Tarreau <w@1wt.eu>
Thu, 7 Apr 2016 17:12:02 +0000 (19:12 +0200)
commit6cd8d13c05ea2b539c8beecd12d0d7d6995d263c
treef158073567d76b05aa2702be0e25ae0b7ac34b1d
parentbb137a8af73e7b83105f2cc0535c0d17a5b52436
OPTIM/MINOR: session: abort if possible before connecting to the backend

Depending on the path that led to sess_update_stream_int(), it's
possible that we had a read error on the frontend, but that we haven't
checked if we may abort the connection.

This was seen in particular the following setup: tcp mode, with
abortonclose set, frontend using ssl. If the ssl connection had a first
successful read, but the second read failed, we would stil try to open a
connection to the backend, although we had enough information to close
the connection early.

sess_update_stream_int() had some logic to handle that case in the
SI_ST_QUE and SI_ST_TAR, but that was missing in the SI_ST_ASS case.

This patches addresses the issue by verifying the state of the req
channel (and the abortonclose option) right before opening the
connection to the backend, so we have the opportunity to close the
connection there, and factorizes the shared SI_ST_{QUE,TAR,ASS} code.
src/stream.c