X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=http_message_api.c;h=2a7a1ebbe6bc7ce7ab83672c52ac1bce2d98554e;hb=62279bb901c6180b0939cff882e69d218ab2206c;hp=65aeaf254c5ea8b447c52360c0008605e6b73bf9;hpb=111fbe75d978a74c3aba074c942d8b2bd5f66223;p=m6w6%2Fext-http diff --git a/http_message_api.c b/http_message_api.c index 65aeaf2..2a7a1eb 100644 --- a/http_message_api.c +++ b/http_message_api.c @@ -250,22 +250,12 @@ PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char } if (!strcasecmp(Z_STRVAL_P(c), "gzip") || !strcasecmp(Z_STRVAL_P(c), "x-gzip")) { -# ifdef HTTP_HAVE_ZLIB - http_encoding_gzdecode(PHPSTR_VAL(msg), PHPSTR_LEN(msg), &decoded, &decoded_len); -# else +# ifndef HTTP_HAVE_ZLIB DECODE_WITH_EXT_ZLIB("gzinflate", PHPSTR_VAL(msg) + 10, PHPSTR_LEN(msg) - 18); -# endif /* HTTP_HAVE_ZLIB */ - } else if (!strcasecmp(Z_STRVAL_P(c), "deflate")) { -# ifdef HTTP_HAVE_ZLIB - http_encoding_inflate(PHPSTR_VAL(msg), PHPSTR_LEN(msg), &decoded, &decoded_len); # else - DECODE_WITH_EXT_ZLIB("gzinflate", PHPSTR_VAL(msg), PHPSTR_LEN(msg)); -# endif /* HTTP_HAVE_ZLIB */ - } else if (!strcasecmp(Z_STRVAL_P(c), "compress") || !strcasecmp(Z_STRVAL_P(c), "x-compress")) { -# ifdef HTTP_HAVE_ZLIB - http_encoding_uncompress(PHPSTR_VAL(msg), PHPSTR_LEN(msg), &decoded, &decoded_len); -# else - DECODE_WITH_EXT_ZLIB("gzuncompress", PHPSTR_VAL(msg), PHPSTR_LEN(msg)); + http_encoding_gzdecode(PHPSTR_VAL(msg), PHPSTR_LEN(msg), &decoded, &decoded_len); + } else if (!strcasecmp(Z_STRVAL_P(c), "deflate") || !strcasecmp(Z_STRVAL_P(c), "compress") || !strcasecmp(Z_STRVAL_P(c), "x-compress")) { + http_encoding_inflate(PHPSTR_VAL(msg), PHPSTR_LEN(msg), &decoded, &decoded_len); # endif /* HTTP_HAVE_ZLIB */ }