From efad299950645cf00ac4a7656d67e5cfa809fe4a Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Thu, 23 Dec 2021 15:56:34 +0100 Subject: [PATCH] [encoding] Removed deflate --- src/encoding/encoding.c | 1 - src/encoding/encoding.h | 1 - src/encoding/gzip.c | 25 ------------------------- src/encoding/gzip.h | 2 -- src/protocol/http/http.c | 2 -- 5 files changed, 31 deletions(-) diff --git a/src/encoding/encoding.c b/src/encoding/encoding.c index 62f5b2ec1..dfc22ef10 100644 --- a/src/encoding/encoding.c +++ b/src/encoding/encoding.c @@ -94,7 +94,6 @@ static const struct decoding_backend *const decoding_backends[] = { &gzip_decoding_backend, &bzip2_decoding_backend, &lzma_decoding_backend, - &deflate_decoding_backend, &brotli_decoding_backend, &zstd_decoding_backend }; diff --git a/src/encoding/encoding.h b/src/encoding/encoding.h index bd724cb59..b5711d714 100644 --- a/src/encoding/encoding.h +++ b/src/encoding/encoding.h @@ -13,7 +13,6 @@ enum stream_encoding { ENCODING_GZIP, ENCODING_BZIP2, ENCODING_LZMA, - ENCODING_DEFLATE, ENCODING_BROTLI, ENCODING_ZSTD, diff --git a/src/encoding/gzip.c b/src/encoding/gzip.c index bee758c79..523af22d4 100644 --- a/src/encoding/gzip.c +++ b/src/encoding/gzip.c @@ -76,13 +76,6 @@ deflate_open(int window_size, struct stream_encoded *stream, int fd) return 0; } -static int -deflate_raw_open(struct stream_encoded *stream, int fd) -{ - /* raw DEFLATE with neither zlib nor gzip header */ - return deflate_open(-MAX_WBITS, stream, fd); -} - static int deflate_gzip_open(struct stream_encoded *stream, int fd) { @@ -233,13 +226,6 @@ restart2: } } -static char * -deflate_raw_decode_buffer(struct stream_encoded *st, char *data, int len, int *new_len) -{ - /* raw DEFLATE with neither zlib nor gzip header */ - return deflate_decode_buffer(st, -MAX_WBITS, data, len, new_len); -} - static char * deflate_gzip_decode_buffer(struct stream_encoded *st, char *data, int len, int *new_len) { @@ -264,17 +250,6 @@ deflate_close(struct stream_encoded *stream) } } -static const char *const deflate_extensions[] = { NULL }; - -const struct decoding_backend deflate_decoding_backend = { - "deflate", - deflate_extensions, - deflate_raw_open, - deflate_read, - deflate_raw_decode_buffer, - deflate_close, -}; - static const char *const gzip_extensions[] = { ".gz", ".tgz", NULL }; const struct decoding_backend gzip_decoding_backend = { diff --git a/src/encoding/gzip.h b/src/encoding/gzip.h index 1a25cbc27..98d4c3155 100644 --- a/src/encoding/gzip.h +++ b/src/encoding/gzip.h @@ -8,10 +8,8 @@ extern "C" { #endif #ifdef CONFIG_GZIP -extern const struct decoding_backend deflate_decoding_backend; extern const struct decoding_backend gzip_decoding_backend; #else -#define deflate_decoding_backend dummy_decoding_backend #define gzip_decoding_backend dummy_decoding_backend #endif diff --git a/src/protocol/http/http.c b/src/protocol/http/http.c index 0676b8bb0..fc9cd4b90 100644 --- a/src/protocol/http/http.c +++ b/src/protocol/http/http.c @@ -1886,8 +1886,6 @@ again: if (file_encoding != ENCODING_GZIP && (!c_strcasecmp(d, "gzip") || !c_strcasecmp(d, "x-gzip"))) conn->content_encoding = ENCODING_GZIP; - if (!c_strcasecmp(d, "deflate") || !c_strcasecmp(d, "x-deflate")) - conn->content_encoding = ENCODING_DEFLATE; #endif #ifdef CONFIG_ZSTD