- clean up
authorMichael Wallner <mike@php.net>
Wed, 14 Dec 2005 11:53:32 +0000 (11:53 +0000)
committerMichael Wallner <mike@php.net>
Wed, 14 Dec 2005 11:53:32 +0000 (11:53 +0000)
http_encoding_api.c
php_http_encoding_api.h

index 6c0d4157b2115ca6b917ffa443c2dc1c675e1186..bff322882ae8c25dbf4566b8f83c95db324bbaa3 100644 (file)
@@ -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;
index aeb75806119ed1ab48554c02443aa22498f65d93..f4a2e52c381e17ccdc203e86541b9485aab087d9 100644 (file)
@@ -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;