BUILD: remove dependency to zlib.h
The build was dependent of the zlib.h header, regardless of the USE_ZLIB
option. The fix consists of several #ifdef in the source code.
It removes the overhead of the zstream structure in the session when you
don't use the option.
diff --git a/include/types/compression.h b/include/types/compression.h
index dfff2f9..6f418fa 100644
--- a/include/types/compression.h
+++ b/include/types/compression.h
@@ -23,8 +23,12 @@
#ifndef _TYPES_COMP_H
#define _TYPES_COMP_H
+#ifdef USE_ZLIB
+
#include <zlib.h>
+#endif /* USE_ZLIB */
+
struct comp {
struct comp_algo *algos;
struct comp_type *types;
@@ -32,7 +36,9 @@
};
struct comp_ctx {
+#ifdef USE_ZLIB
z_stream strm; /* zlib stream */
+#endif /* USE_ZLIB */
};
struct comp_algo {
diff --git a/include/types/session.h b/include/types/session.h
index 5546be8..ae11f81 100644
--- a/include/types/session.h
+++ b/include/types/session.h
@@ -33,6 +33,7 @@
#include <types/channel.h>
#include <types/compression.h>
+
#include <types/proto_http.h>
#include <types/proxy.h>
#include <types/queue.h>