BUG/MEDIUM: http-fetch: Don't fetch the method if there is no stream

The "method" sample fetch does not perform any check on the stream existence
before using it. However, for errors triggered at the mux level, there is no
stream. When the log message is formatted, this sample fetch must fail. It
must also fail when it is called from a health-check.

This patch must be backported as far as 2.4.
This commit is contained in:
Christopher Faulet 2022-07-06 17:53:02 +02:00
parent d1d983fb12
commit 12f6dbb863

View File

@ -337,7 +337,7 @@ static int smp_fetch_meth(const struct arg *args, struct sample *smp, const char
struct htx *htx; struct htx *htx;
int meth; int meth;
txn = smp->strm->txn; txn = (smp->strm ? smp->strm->txn : NULL);
if (!txn) if (!txn)
return 0; return 0;