int http_compression_buffer_add_data(struct session *s, struct buffer *in, struct buffer *out);
int http_compression_buffer_end(struct session *s, struct buffer **in, struct buffer **out, int end);
-int identity_init(struct comp_ctx **comp_ctx, int level);
-int identity_add_data(struct comp_ctx *comp_ctx, const char *in_data, int in_len, struct buffer *out);
-int identity_flush(struct comp_ctx *comp_ctx, struct buffer *out, int flag);
-int identity_reset(struct comp_ctx *comp_ctx);
-int identity_end(struct comp_ctx **comp_ctx);
-
-
-
#ifdef USE_ZLIB
extern long zlib_used_memory;
-
-int deflate_init(struct comp_ctx **comp_ctx, int level);
-int deflate_add_data(struct comp_ctx *comp_ctx, const char *in_data, int in_len, struct buffer *out);
-int deflate_flush(struct comp_ctx *comp_ctx, struct buffer *out, int flag);
-int deflate_reset(struct comp_ctx *comp_ctx);
-int deflate_end(struct comp_ctx **comp_ctx);
-
-int gzip_init(struct comp_ctx **comp_ctx, int level);
#endif /* USE_ZLIB */
#endif /* _PROTO_COMP_H */
unsigned int compress_min_idle = 0;
static struct pool_head *pool_comp_ctx = NULL;
+static int identity_init(struct comp_ctx **comp_ctx, int level);
+static int identity_add_data(struct comp_ctx *comp_ctx, const char *in_data, int in_len, struct buffer *out);
+static int identity_flush(struct comp_ctx *comp_ctx, struct buffer *out, int flag);
+static int identity_reset(struct comp_ctx *comp_ctx);
+static int identity_end(struct comp_ctx **comp_ctx);
+
+#ifdef USE_ZLIB
+static int gzip_init(struct comp_ctx **comp_ctx, int level);
+static int deflate_init(struct comp_ctx **comp_ctx, int level);
+static int deflate_add_data(struct comp_ctx *comp_ctx, const char *in_data, int in_len, struct buffer *out);
+static int deflate_flush(struct comp_ctx *comp_ctx, struct buffer *out, int flag);
+static int deflate_reset(struct comp_ctx *comp_ctx);
+static int deflate_end(struct comp_ctx **comp_ctx);
+#endif /* USE_ZLIB */
+
const struct comp_algo comp_algos[] =
{
/*
* Init the identity algorithm
*/
-int identity_init(struct comp_ctx **comp_ctx, int level)
+static int identity_init(struct comp_ctx **comp_ctx, int level)
{
return 0;
}
* Process data
* Return size of consumed data or -1 on error
*/
-int identity_add_data(struct comp_ctx *comp_ctx, const char *in_data, int in_len, struct buffer *out)
+static int identity_add_data(struct comp_ctx *comp_ctx, const char *in_data, int in_len, struct buffer *out)
{
char *out_data = bi_end(out);
int out_len = out->size - buffer_len(out);
return in_len;
}
-int identity_flush(struct comp_ctx *comp_ctx, struct buffer *out, int flag)
+static int identity_flush(struct comp_ctx *comp_ctx, struct buffer *out, int flag)
{
return 0;
}
-int identity_reset(struct comp_ctx *comp_ctx)
+static int identity_reset(struct comp_ctx *comp_ctx)
{
return 0;
}
/*
* Deinit the algorithm
*/
-int identity_end(struct comp_ctx **comp_ctx)
+static int identity_end(struct comp_ctx **comp_ctx)
{
return 0;
}
/**************************
**** gzip algorithm ****
***************************/
-int gzip_init(struct comp_ctx **comp_ctx, int level)
+static int gzip_init(struct comp_ctx **comp_ctx, int level)
{
z_stream *strm;
**** Deflate algorithm ****
***************************/
-int deflate_init(struct comp_ctx **comp_ctx, int level)
+static int deflate_init(struct comp_ctx **comp_ctx, int level)
{
z_stream *strm;
}
/* Return the size of consumed data or -1 */
-int deflate_add_data(struct comp_ctx *comp_ctx, const char *in_data, int in_len, struct buffer *out)
+static int deflate_add_data(struct comp_ctx *comp_ctx, const char *in_data, int in_len, struct buffer *out)
{
int ret;
z_stream *strm = &comp_ctx->strm;
return in_len - strm->avail_in;
}
-int deflate_flush(struct comp_ctx *comp_ctx, struct buffer *out, int flag)
+static int deflate_flush(struct comp_ctx *comp_ctx, struct buffer *out, int flag)
{
int ret;
int out_len = 0;
return out_len;
}
-int deflate_reset(struct comp_ctx *comp_ctx)
+static int deflate_reset(struct comp_ctx *comp_ctx)
{
z_stream *strm = &comp_ctx->strm;
return -1;
}
-int deflate_end(struct comp_ctx **comp_ctx)
+static int deflate_end(struct comp_ctx **comp_ctx)
{
z_stream *strm = &(*comp_ctx)->strm;
int ret;