-#ifdef HTTP_HAVE_ZLIB
-
-static const char http_encoding_gzip_header[] = {
- (const char) 0x1f, // fixed value
- (const char) 0x8b, // fixed value
- (const char) Z_DEFLATED, // compression algorithm
- (const char) 0, // none of the possible flags defined by the GZIP "RFC"
- (const char) 0, // no MTIME available (4 bytes)
- (const char) 0, // =*=
- (const char) 0, // =*=
- (const char) 0, // =*=
- (const char) 0, // two possible flag values for 9 compression levels? o_O
- (const char) 0x03 // assume *nix OS
-};
-
-inline void http_init_gzencode_buffer(z_stream *Z, const char *data, size_t data_len, char **buf_ptr)
-{
- Z->zalloc = Z_NULL;
- Z->zfree = Z_NULL;
- Z->opaque = Z_NULL;
-
- Z->next_in = (Bytef *) data;
- Z->avail_in = data_len;
- Z->avail_out = HTTP_ENCODING_BUFLEN(data_len) + HTTP_ENCODING_SAFPAD - 1;
-
- *buf_ptr = emalloc(HTTP_ENCODING_BUFLEN(data_len) + sizeof(http_encoding_gzip_header) + HTTP_ENCODING_SAFPAD);
- memcpy(*buf_ptr, http_encoding_gzip_header, sizeof(http_encoding_gzip_header));
-
- Z->next_out = (Bytef *) *buf_ptr + sizeof(http_encoding_gzip_header);
-}
-
-inline void http_init_deflate_buffer(z_stream *Z, const char *data, size_t data_len, char **buf_ptr)
-{
- Z->zalloc = Z_NULL;
- Z->zfree = Z_NULL;
- Z->opaque = Z_NULL;
-
- Z->data_type = Z_UNKNOWN;
- Z->next_in = (Bytef *) data;
- Z->avail_in = data_len;
- Z->avail_out = HTTP_ENCODING_BUFLEN(data_len) - 1;
- Z->next_out = emalloc(HTTP_ENCODING_BUFLEN(data_len));
-
- *buf_ptr = (char *) Z->next_out;
-}
-
-inline void http_init_uncompress_buffer(size_t data_len, char **buf_ptr, size_t *buf_len, int *iteration)