]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: report zlib support in haproxy -vv
authorCyril Bonté <cyril.bonte@free.fr>
Sat, 10 Nov 2012 18:27:47 +0000 (19:27 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 10 Nov 2012 19:36:46 +0000 (20:36 +0100)
Compression algorithms are not always supported depending on build options.
"haproxy -vv" now reports if zlib is supported and lists compression algorithms
also supported.

src/compression.c
src/haproxy.c

index 983e77136c37534bfeab94f0de191c5d76e56f86..300a0bd40841b1746f35e8dd5d8c80b61842ce92 100644 (file)
@@ -50,7 +50,7 @@ static long long zlib_memory_available = -1;
 #endif
 
 
-static const struct comp_algo comp_algos[] =
+const struct comp_algo comp_algos[] =
 {
        { "identity", 8, identity_init, identity_add_data, identity_flush, identity_reset, identity_end },
 #ifdef USE_ZLIB
index cfd6f84396e5f99a4fdf7c4b4cc77f093e37d732..d973ae282eb05dc98c3d1e6302e3b071f9426033 100644 (file)
 
 /*********************************************************************/
 
+extern const struct comp_algo comp_algos[];
+
 /*********************************************************************/
 
 /* list of config files */
@@ -225,6 +227,24 @@ void display_build_opts()
 #endif
                "\n");
 
+#ifdef USE_ZLIB
+       printf("Built with zlib version : " ZLIB_VERSION "\n");
+#else /* USE_ZLIB */
+       printf("Built without zlib support (USE_ZLIB not set)\n");
+#endif
+       printf("Compression algorithms supported :");
+       {
+               int i;
+
+               for (i = 0; comp_algos[i].name; i++) {
+                       printf("%s %s", (i == 0 ? "" : ","), comp_algos[i].name);
+               }
+               if (i == 0) {
+                       printf("none");
+               }
+       }
+       printf("\n");
+
 #ifdef USE_OPENSSL
        printf("Built with OpenSSL version : " OPENSSL_VERSION_TEXT "\n");
        printf("OpenSSL library supports TLS extensions : "