MINOR: log: Don't depends on a stream to process samples in log-format string
When a log-format string is evaluated, there is no reason to process sample
fetches only when a stream is defined. Several sample fetches are available
outside the stream scope. All others should handle calls without stream. This
patch is mandatory to support log-format string in tcp-check rules.
diff --git a/src/log.c b/src/log.c
index 5204de2..4f3c7c7 100644
--- a/src/log.c
+++ b/src/log.c
@@ -2065,9 +2065,9 @@
case LOG_FMT_EXPR: // sample expression, may be request or response
key = NULL;
- if (tmp->options & LOG_OPT_REQ_CAP && s)
+ if (tmp->options & LOG_OPT_REQ_CAP)
key = sample_fetch_as_type(be, sess, s, SMP_OPT_DIR_REQ|SMP_OPT_FINAL, tmp->expr, SMP_T_STR);
- if (!key && (tmp->options & LOG_OPT_RES_CAP) && s)
+ if (!key && (tmp->options & LOG_OPT_RES_CAP))
key = sample_fetch_as_type(be, sess, s, SMP_OPT_DIR_RES|SMP_OPT_FINAL, tmp->expr, SMP_T_STR);
if (tmp->options & LOG_OPT_HTTP)
ret = lf_encode_chunk(tmplog, dst + maxsize,