- remove http_compress() and http_uncompress() (deflate/inflate ambiguity)
[m6w6/ext-http] / http_message_api.c
index cd9a9514655f7107fcc5a0ed5c6fdd355086a04d..2a7a1ebbe6bc7ce7ab83672c52ac1bce2d98554e 100644 (file)
@@ -135,7 +135,7 @@ PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char
                return NULL;
        }
 
-       msg = http_message_init(msg);
+       msg = http_message_init_rel(msg, 0);
 
        if (SUCCESS != http_parse_headers_cb(message, &msg->hdrs, 1, (http_info_callback) http_message_info_callback, (void **) &msg)) {
                if (free_msg) {
@@ -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 */
                        }
                        
@@ -304,7 +294,7 @@ PHP_HTTP_API http_message *_http_message_parse_ex(http_message *msg, const char
                                http_message *next = NULL, *most = NULL;
 
                                /* set current message to parent of most parent following messages and return deepest */
-                               if ((most = next = http_message_parse(continue_at, message + message_length - continue_at))) {
+                               if ((most = next = http_message_parse_rel(NULL, continue_at, message + message_length - continue_at))) {
                                        while (most->parent) most = most->parent;
                                        most->parent = msg;
                                        msg = next;