X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_encoding_api.h;h=9cde6e7953a9fb0748a2c00069750978134c4935;hp=4c01360b5df6f42f365ca28bc41f48c9f4da08b4;hb=32e91737086db53bb1fd9ed9f79d693c43ec459f;hpb=7b88d9022c90eb12e5fe195af8644935141c9d68 diff --git a/php_http_encoding_api.h b/php_http_encoding_api.h index 4c01360..9cde6e7 100644 --- a/php_http_encoding_api.h +++ b/php_http_encoding_api.h @@ -6,7 +6,7 @@ | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ - | Copyright (c) 2004-2005, Michael Wallner | + | Copyright (c) 2004-2006, Michael Wallner | +--------------------------------------------------------------------+ */ @@ -27,19 +27,20 @@ extern PHP_MINIT_FUNCTION(http_encoding); extern PHP_RINIT_FUNCTION(http_encoding); extern PHP_RSHUTDOWN_FUNCTION(http_encoding); -/* 100% compression should be fairly good */ -#define HTTP_ENCODING_MAXTRY 100 -/* safe padding */ -#define HTTP_ENCODING_SAFPAD 28 -/* add 1% extra space in case we need to encode widely differing (binary) data */ -#define HTTP_ENCODING_BUFLEN(l) (l + (l / 100) + HTTP_ENCODING_SAFPAD) - typedef enum { HTTP_ENCODING_NONE, HTTP_ENCODING_GZIP, HTTP_ENCODING_DEFLATE, } http_encoding_type; +#define HTTP_INFLATE_ROUNDS 100 + +#define HTTP_DEFLATE_BUFFER_SIZE_GUESS(S) \ + (((size_t) ((double) S * (double) 1.015)) + 10 + 8 + 4 + 1) + +#define HTTP_DEFLATE_BUFFER_SIZE 0x8000 +#define HTTP_INFLATE_BUFFER_SIZE 0x1000 + #define HTTP_DEFLATE_LEVEL_DEF 0x00000000 #define HTTP_DEFLATE_LEVEL_MIN 0x00000001 #define HTTP_DEFLATE_LEVEL_MAX 0x00000002 @@ -96,10 +97,11 @@ PHP_HTTP_API void _http_encoding_inflate_stream_dtor(http_encoding_stream *s TSR PHP_HTTP_API void _http_encoding_inflate_stream_free(http_encoding_stream **s TSRMLS_DC); #define http_ob_deflatehandler(o, ol, h, hl, m) _http_ob_deflatehandler((o), (ol), (h), (hl), (m) TSRMLS_CC) -void _http_ob_deflatehandler(char *, uint, char **, uint *, int TSRMLS_DC); +extern void _http_ob_deflatehandler(char *, uint, char **, uint *, int TSRMLS_DC); #define http_ob_inflatehandler(o, ol, h, hl, m) _http_ob_inflatehandler((o), (ol), (h), (hl), (m) TSRMLS_CC) -void _http_ob_inflatehandler(char *, uint, char **, uint *, int TSRMLS_DC); +extern void _http_ob_inflatehandler(char *, uint, char **, uint *, int TSRMLS_DC); + #endif /* HTTP_HAVE_ZLIB */ #endif