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);
}
}
+retry_inflate:
Z.next_in = (Bytef *) data;
Z.avail_in = data_len;
Z.next_out = (Bytef *) *decoded;
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;