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 |    2 +-
 src/haproxy.c     |   20 ++++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/src/compression.c b/src/compression.c
index 4c942aa..e8a3fe1 100644
--- a/src/compression.c
+++ b/src/compression.c
@@ -49,7 +49,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
diff --git a/src/haproxy.c b/src/haproxy.c
index d0e740b..3b3a8c7 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -101,6 +101,8 @@
 
 /*********************************************************************/
 
+extern const struct comp_algo comp_algos[];
+
 /*********************************************************************/
 
 /* list of config files */
@@ -223,6 +225,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 : "
-- 
1.7.10.4


Reply via email to