]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: log: Fix compilation without SSL support
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 27 Oct 2021 09:58:05 +0000 (11:58 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 27 Oct 2021 10:00:15 +0000 (12:00 +0200)
When compiled without SSL support, a variable is reported as not used by
GCC.

src/log.c: In function ‘sess_build_logline’:
src/log.c:2056:36: error: unused variable ‘conn’ [-Werror=unused-variable]
 2056 |                 struct connection *conn;
      |                                    ^~~~

This does not need to be backported.

src/log.c

index 4734508c484838c871e0099da1fa34c149a54a9f..6912217de3379401c8fb0ad1bf5390eea5b8b24c 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -2052,7 +2052,9 @@ int sess_build_logline(struct session *sess, struct stream *s, char *dst, size_t
                return 0;
 
        list_for_each_entry(tmp, list_format, list) {
+#ifdef USE_OPENSSL
                struct connection *conn;
+#endif
                const struct sockaddr_storage *addr;
                const char *src = NULL;
                struct sample *key;