aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjcid <devnull@localhost>2008-09-24 16:20:42 +0200
committerjcid <devnull@localhost>2008-09-24 16:20:42 +0200
commit642f9b3e747859a7256ea12fab9f9ed50aa9253a (patch)
treebdd7b81d5e45ea595e3c70ae6b7d42de702b7685 /src
parent5b3d1e2e437423d9f144caf5121a6d48bd14bef8 (diff)
- Added "x-gzip" as "gzip" synonym.
Diffstat (limited to 'src')
-rw-r--r--src/decode.c40
1 files changed, 22 insertions, 18 deletions
diff --git a/src/decode.c b/src/decode.c
index 1a912db9..ff4fcb27 100644
--- a/src/decode.c
+++ b/src/decode.c
@@ -219,24 +219,28 @@ Decode *a_Decode_content_init(const char *format)
{
Decode *dc = NULL;
- if (format && !dStrcasecmp(format, "gzip")) {
- _MSG("gzipped data!\n");
-
- z_stream *zs;
- dc = dNew(Decode, 1);
- dc->buffer = dNew(char, bufsize);
- dc->state = zs = dNew(z_stream, 1);
- zs->zalloc = NULL;
- zs->zfree = NULL;
- zs->next_in = NULL;
- zs->avail_in = 0;
-
- /* 16 is a magic number for gzip decoding */
- inflateInit2(zs, MAX_WBITS+16);
-
- dc->decode = Decode_gzip;
- dc->free = Decode_gzip_free;
- dc->leftover = NULL; /* not used */
+ if (format && *format) {
+ if (!dStrcasecmp(format, "gzip") || !dStrcasecmp(format, "x-gzip")) {
+ _MSG("gzipped data!\n");
+
+ z_stream *zs;
+ dc = dNew(Decode, 1);
+ dc->buffer = dNew(char, bufsize);
+ dc->state = zs = dNew(z_stream, 1);
+ zs->zalloc = NULL;
+ zs->zfree = NULL;
+ zs->next_in = NULL;
+ zs->avail_in = 0;
+
+ /* 16 is a magic number for gzip decoding */
+ inflateInit2(zs, MAX_WBITS+16);
+
+ dc->decode = Decode_gzip;
+ dc->free = Decode_gzip_free;
+ dc->leftover = NULL; /* not used */
+ } else {
+ MSG("Content-Encoding '%s' not recognized.\n", format);
+ }
}
return dc;
}