From: Michael Wallner Date: Wed, 14 Dec 2005 11:53:32 +0000 (+0000) Subject: - clean up X-Git-Tag: RELEASE_0_20_0~7 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=4e4645f7a6e147eb1b4cab1a25176a7ea3f8db0d;p=m6w6%2Fext-http - clean up --- diff --git a/http_encoding_api.c b/http_encoding_api.c index 6c0d415..bff3228 100644 --- a/http_encoding_api.c +++ b/http_encoding_api.c @@ -245,19 +245,13 @@ PHP_HTTP_API STATUS _http_encoding_inflate(const char *data, size_t data_len, ch STATUS status; z_stream Z; - *decoded = NULL; - *decoded_len = 0; - -retry_inflate: do { Z.zalloc = Z_NULL; Z.zfree = Z_NULL; if (!max) { - if (!*decoded) { - *decoded_len = data_len * 2; - *decoded = emalloc(*decoded_len + 1); - } + *decoded_len = data_len * 2; + *decoded = emalloc(*decoded_len + 1); } else { size_t new_len = *decoded_len << 2; char *new_ptr = erealloc_recoverable(*decoded, new_len + 1); @@ -270,6 +264,7 @@ retry_inflate: } } +retry_inflate: Z.next_in = (Bytef *) data; Z.avail_in = data_len; Z.next_out = (Bytef *) *decoded; diff --git a/php_http_encoding_api.h b/php_http_encoding_api.h index aeb7580..f4a2e52 100644 --- a/php_http_encoding_api.h +++ b/php_http_encoding_api.h @@ -36,17 +36,10 @@ PHP_HTTP_API zend_bool _http_encoding_response_start(size_t content_length TSRML typedef enum { HTTP_ENCODING_NONE = 0, - HTTP_ENCODING_ANY = 1, HTTP_ENCODING_GZIP, HTTP_ENCODING_DEFLATE, - HTTP_ENCODING_COMPRESS } http_encoding_type; -#define http_encode(t, l, d, dl, r, rl) _http_encode((t), (l), (d), (dl), (r), (rl) TSRMLS_CC) -PHP_HTTP_API STATUS _http_encode(http_encoding_type type, int level, const char *data, size_t data_len, char **encoded, size_t *encoded_len TSRMLS_DC); -#define http_decode(t, d, dl, r, rl) _http_decode((t), (l), (d), (dl), (r), (rl) TSRMLS_CC) -PHP_HTTP_API STATUS _http_decode(http_encoding_type type, const char *data, size_t data_len, char **decoded, size_t *decoded_len TSRMLS_DC); - typedef struct { z_stream Z; int gzip;