]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: log: don't check the stream-int's conn_retries if the stream is NULL
authorWilly Tarreau <w@1wt.eu>
Tue, 4 Sep 2018 17:21:44 +0000 (19:21 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 5 Sep 2018 18:01:23 +0000 (20:01 +0200)
Let's simply forget the conn_retries when there is no stream since we
haven't tried to connect yet.

src/log.c

index 7ac555d0793849ae97f03d8aaa78609848e6e96f..19b448f3cb0a2f6495c8aa527e6de3eedf2abf4a 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -2121,7 +2121,7 @@ int sess_build_logline(struct session *sess, struct stream *s, char *dst, size_t
                        case LOG_FMT_RETRIES:  // %rq
                                if (s->flags & SF_REDISP)
                                        LOGCHAR('+');
-                               ret = ltoa_o((s->si[1].conn_retries>0) ?
+                               ret = ltoa_o((s && s->si[1].conn_retries > 0) ?
                                                (be->conn_retries - s->si[1].conn_retries) :
                                                be->conn_retries, tmplog, dst + maxsize - tmplog);
                                if (ret == NULL)