MEDIUM: compression: don't compress when no data
This patch makes changes in the http_response_forward_body state
machine. It checks if the compress algorithm had consumed data before
swapping the temporary and the input buffer. So it prevents null sized
zlib chunks.
diff --git a/include/types/compression.h b/include/types/compression.h
index da356ad..cf56e45 100644
--- a/include/types/compression.h
+++ b/include/types/compression.h
@@ -51,7 +51,7 @@
char *name;
int name_len;
int (*init)(struct comp_ctx *comp_ctx, int level);
- int (*add_data)(struct comp_ctx *comp_ctx, const char *in_data, int in_len, char *out_data, int out_len);
+ 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);