]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: compression: remove unused reset functions
authorWilly Tarreau <w@1wt.eu>
Sat, 28 Mar 2015 21:08:25 +0000 (22:08 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 28 Mar 2015 21:08:25 +0000 (22:08 +0100)
It's unclear what purpose these functions used to server, however they
are not used anywhere, one good reason to remove them.

include/types/compression.h
src/compression.c

index 376eea9ef8923817b692ab609b7e2d26fb3762da..d062d237e8f947d4e6dff1119e16e03db315b902 100644 (file)
@@ -64,7 +64,6 @@ struct comp_algo {
        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 (*finish)(struct comp_ctx *comp_ctx, struct buffer *out);
-       int (*reset)(struct comp_ctx *comp_ctx);
        int (*end)(struct comp_ctx **comp_ctx);
        struct comp_algo *next;
 };
index fd053d5409be3ec23b4204f0299feaa3bc186748..004c5e2efce4cb9b2e41cc23394b119efbbafd50 100644 (file)
@@ -59,28 +59,28 @@ 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);
 static int identity_finish(struct comp_ctx *comp_ctx, struct buffer *out);
-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 raw_def_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);
 static int deflate_finish(struct comp_ctx *comp_ctx, struct buffer *out);
-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[] =
 {
-       { "identity",     8, "identity", 8, identity_init, identity_add_data, identity_flush, identity_finish, identity_reset, identity_end },
+       { "identity",     8, "identity", 8, identity_init, identity_add_data, identity_flush, identity_finish, identity_end },
 #ifdef USE_ZLIB
-       { "deflate",      7, "deflate",  7, deflate_init,  deflate_add_data,  deflate_flush,  deflate_finish,  deflate_reset,  deflate_end },
-       { "raw-deflate", 11, "deflate",  7, raw_def_init,  deflate_add_data,  deflate_flush,  deflate_finish,  deflate_reset,  deflate_end },
-       { "gzip",         4, "gzip",     4, gzip_init,     deflate_add_data,  deflate_flush,  deflate_finish,  deflate_reset,  deflate_end },
+       { "deflate",      7, "deflate",  7, deflate_init,  deflate_add_data,  deflate_flush,  deflate_finish,  deflate_end },
+       { "raw-deflate", 11, "deflate",  7, raw_def_init,  deflate_add_data,  deflate_flush,  deflate_finish,  deflate_end },
+       { "gzip",         4, "gzip",     4, gzip_init,     deflate_add_data,  deflate_flush,  deflate_finish,  deflate_end },
 #endif /* USE_ZLIB */
        { NULL,       0, NULL,          0, NULL ,         NULL,              NULL,           NULL,           NULL }
 };
@@ -665,15 +665,6 @@ static int deflate_finish(struct comp_ctx *comp_ctx, struct buffer *out)
        return deflate_flush_or_finish(comp_ctx, out, Z_FINISH);
 }
 
-static int deflate_reset(struct comp_ctx *comp_ctx)
-{
-       z_stream *strm = &comp_ctx->strm;
-
-       if (deflateReset(strm) == Z_OK)
-               return 0;
-       return -1;
-}
-
 static int deflate_end(struct comp_ctx **comp_ctx)
 {
        z_stream *strm = &(*comp_ctx)->strm;