]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: log: Don't call sample_fetch_as_type if we don't have a stream.
authorOlivier Houchard <cognet@ci0.org>
Sat, 15 Dec 2018 13:00:06 +0000 (14:00 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 15 Dec 2018 13:34:31 +0000 (14:34 +0100)
commitf90db445cd8308e9a40b7db950fd4b35c3c06179
tree7f4e83d24be10d8cc1531d34e4aa10553a5a9630
parenta57b7e33ef5587562873897aea9c91470a206220
BUG/MEDIUM: log: Don't call sample_fetch_as_type if we don't have a stream.

In sess_build_logline(), don't attempt to call sample_fetch_as_type()
if we don't have a stream.

It used never to happen in the past before commit 09bb27c ("MEDIUM: log:
make sess_build_logline() support being called with no stream"). But now
it can happen when sess_log() is called from the lower layers (i.e. the
H2 mux got garbage when it was expecting a preface frame), and it reveals
that some sample fetch functions and some converter fnuctions which rely
on the stream don't test for its existence. For the sample fetch functions,
a durable solution is easy and would consist in adapting sample_process()
to verify the SMP_USE_* bits when the stream is not set. But for the
converters we don't have this option as they don't declare whether or not
they use a stream (which possibly is the real issue).

Thus for now let's disable sample_fetch_as_type() if a stream does not
exist, until it can be more accurately refined later.
src/log.c