MEDIUM: compression: use pool for comp_ctx
Use pool for comp_ctx, it is allocated during the comp_algo->init().
The allocation of comp_ctx is accounted for in the zlib_memory_available.
diff --git a/include/types/compression.h b/include/types/compression.h
index cf56e45..e4b1f27 100644
--- a/include/types/compression.h
+++ b/include/types/compression.h
@@ -50,11 +50,11 @@
struct comp_algo {
char *name;
int name_len;
- int (*init)(struct comp_ctx *comp_ctx, int level);
+ int (*init)(struct comp_ctx **comp_ctx, int level);
int (*add_data)(struct comp_ctx *comp_ctx, const char *in_data, int in_len, struct buffer *out);
int (*flush)(struct comp_ctx *comp_ctx, struct buffer *out, int flag);
int (*reset)(struct comp_ctx *comp_ctx);
- int (*end)(struct comp_ctx *comp_ctx);
+ int (*end)(struct comp_ctx **comp_ctx);
struct comp_algo *next;
};
diff --git a/include/types/session.h b/include/types/session.h
index 284b7e8..e0d3c22 100644
--- a/include/types/session.h
+++ b/include/types/session.h
@@ -159,7 +159,7 @@
void (*srv_error)(struct session *s, /* the function to call upon unrecoverable server errors (or NULL) */
struct stream_interface *si);
unsigned int uniq_id; /* unique ID used for the traces */
- struct comp_ctx comp_ctx; /* HTTP compression context */
+ struct comp_ctx *comp_ctx; /* HTTP compression context */
struct comp_algo *comp_algo; /* HTTP compression algorithm if not NULL */
char *unique_id; /* custom unique ID */
};