X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_encoding.c;h=4a71c80074d24f1ea902a641df09810c13653312;hp=34c6922d4c9daa82f082552ca02d6dd983a5c635;hb=7b028d0cbb030f9610084314f67b77907d8474a2;hpb=d3485e3b28336153dca690e872ffe1ddc60fedd2 diff --git a/php_http_encoding.c b/php_http_encoding.c index 34c6922..4a71c80 100644 --- a/php_http_encoding.c +++ b/php_http_encoding.c @@ -6,13 +6,13 @@ | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ - | Copyright (c) 2004-2010, Michael Wallner | + | Copyright (c) 2004-2011, Michael Wallner | +--------------------------------------------------------------------+ */ -/* $Id: http_encoding_api.c 298592 2010-04-26 11:47:29Z mike $ */ +#include "php_http_api.h" -#include "php_http.h" +#include static inline int eol_match(char **line, int *eol_len) { @@ -35,7 +35,7 @@ PHP_HTTP_API const char *php_http_encoding_dechunk(const char *encoded, size_t e const char *e_ptr = encoded; *decoded_len = 0; - *decoded = ecalloc(1, encoded_len); + *decoded = ecalloc(1, encoded_len + 1); while ((encoded + encoded_len - e_ptr) > 0) { ulong chunk_len = 0, rest; @@ -53,6 +53,7 @@ PHP_HTTP_API const char *php_http_encoding_dechunk(const char *encoded, size_t e php_http_error(HE_NOTICE, PHP_HTTP_E_ENCODING, "Data does not seem to be chunked encoded"); memcpy(*decoded, encoded, encoded_len); *decoded_len = encoded_len; + decoded[*decoded_len] = '\0'; return encoded + encoded_len; } else { efree(*decoded); @@ -111,7 +112,7 @@ PHP_HTTP_API const char *php_http_encoding_dechunk(const char *encoded, size_t e static inline int php_http_inflate_rounds(z_stream *Z, int flush, char **buf, size_t *len) { int status = 0, round = 0; - php_http_buffer buffer; + php_http_buffer_t buffer; *buf = NULL; *len = 0; @@ -128,9 +129,7 @@ static inline int php_http_inflate_rounds(z_stream *Z, int flush, char **buf, si fprintf(stderr, "\n%3d: %3d PRIOR: size=%7lu,\tfree=%7lu,\tused=%7lu,\tavail_in=%7lu,\tavail_out=%7lu\n", round, status, buffer.size, buffer.free, buffer.used, Z->avail_in, Z->avail_out); #endif status = inflate(Z, flush); - - buffer.used += buffer.free - Z->avail_out; - buffer.free = Z->avail_out; + php_http_buffer_account(&buffer, buffer.free - Z->avail_out); #if 0 fprintf(stderr, "%3d: %3d AFTER: size=%7lu,\tfree=%7lu,\tused=%7lu,\tavail_in=%7lu,\tavail_out=%7lu\n", round, status, buffer.size, buffer.free, buffer.used, Z->avail_in, Z->avail_out); #endif @@ -202,7 +201,7 @@ retry_raw_inflate: status = inflateInit2(&Z, wbits); if (Z_OK == status) { Z.next_in = (Bytef *) data; - Z.avail_in = data_len; + Z.avail_in = data_len + 1; /* include the terminating NULL, see #61287 */ switch (status = php_http_inflate_rounds(&Z, Z_NO_FLUSH, decoded, decoded_len)) { case Z_STREAM_END: @@ -220,6 +219,7 @@ retry_raw_inflate: wbits = PHP_HTTP_WINDOW_BITS_RAW; goto retry_raw_inflate; } + break; } inflateEnd(&Z); @@ -264,11 +264,31 @@ PHP_HTTP_API php_http_encoding_stream_t *php_http_encoding_stream_copy(php_http_ { TSRMLS_FETCH_FROM_CTX(from->ts); - if (!from->ops->copy) { - return NULL; + if (from->ops->copy) { + int freeme; + php_http_encoding_stream_t *ns; + + if ((freeme = !to)) { + to = pemalloc(sizeof(*to), (from->flags & PHP_HTTP_ENCODING_STREAM_PERSISTENT)); + } + memset(to, 0, sizeof(*to)); + + to->flags = from->flags; + to->ops = from->ops; + TSRMLS_SET_CTX(to->ts); + + if ((ns = to->ops->copy(from, to))) { + return ns; + } else { + return to; + } + + if (freeme) { + pefree(to, (to->flags & PHP_HTTP_ENCODING_STREAM_PERSISTENT)); + } } - return from->ops->copy(from, php_http_encoding_stream_init(to, from->ops, from->flags TSRMLS_CC)); + return NULL; } PHP_HTTP_API STATUS php_http_encoding_stream_reset(php_http_encoding_stream_t **s) @@ -295,6 +315,8 @@ PHP_HTTP_API STATUS php_http_encoding_stream_update(php_http_encoding_stream_t * PHP_HTTP_API STATUS php_http_encoding_stream_flush(php_http_encoding_stream_t *s, char **out_str, size_t *out_len) { if (!s->ops->flush) { + *out_str = NULL; + *out_len = 0; return SUCCESS; } return s->ops->flush(s, out_str, out_len); @@ -311,6 +333,8 @@ PHP_HTTP_API zend_bool php_http_encoding_stream_done(php_http_encoding_stream_t PHP_HTTP_API STATUS php_http_encoding_stream_finish(php_http_encoding_stream_t *s, char **out_str, size_t *out_len) { if (!s->ops->finish) { + *out_str = NULL; + *out_len = 0; return SUCCESS; } return s->ops->finish(s, out_str, out_len); @@ -335,7 +359,7 @@ PHP_HTTP_API void php_http_encoding_stream_free(php_http_encoding_stream_t **s) } struct dechunk_ctx { - php_http_buffer buffer; + php_http_buffer_t buffer; ulong hexlen; unsigned zeroed:1; }; @@ -387,7 +411,6 @@ static php_http_encoding_stream_t *inflate_init(php_http_encoding_stream_t *s) static php_http_encoding_stream_t *dechunk_init(php_http_encoding_stream_t *s) { struct dechunk_ctx *ctx = pecalloc(1, sizeof(*ctx), (s->flags & PHP_HTTP_ENCODING_STREAM_PERSISTENT)); - TSRMLS_FETCH_FROM_CTX(s->ts); if (!php_http_buffer_init_ex(&ctx->buffer, PHP_HTTP_BUFFER_DEFAULT_SIZE, (s->flags & PHP_HTTP_ENCODING_STREAM_PERSISTENT) ? PHP_HTTP_BUFFER_INIT_PERSISTENT : 0)) { return NULL; @@ -402,33 +425,58 @@ static php_http_encoding_stream_t *dechunk_init(php_http_encoding_stream_t *s) static php_http_encoding_stream_t *deflate_copy(php_http_encoding_stream_t *from, php_http_encoding_stream_t *to) { - z_streamp from_ctx = from->ctx, to_ctx = to->ctx; - - deflateCopy(to_ctx, from_ctx); - php_http_buffer_append(to_ctx->opaque, PHP_HTTP_BUFFER_VAL(from_ctx->opaque), PHP_HTTP_BUFFER_LEN(from_ctx->opaque)); + int status, p = to->flags & PHP_HTTP_ENCODING_STREAM_PERSISTENT; + z_streamp from_ctx = from->ctx, to_ctx = pecalloc(1, sizeof(*to_ctx), p); + TSRMLS_FETCH_FROM_CTX(from->ts); - return to; + if (Z_OK == (status = deflateCopy(to_ctx, from_ctx))) { + if ((to_ctx->opaque = php_http_buffer_init_ex(NULL, PHP_HTTP_DEFLATE_BUFFER_SIZE, p ? PHP_HTTP_BUFFER_INIT_PERSISTENT : 0))) { + php_http_buffer_append(to_ctx->opaque, PHP_HTTP_BUFFER_VAL(from_ctx->opaque), PHP_HTTP_BUFFER_LEN(from_ctx->opaque)); + to->ctx = to_ctx; + return to; + } + deflateEnd(to_ctx); + status = Z_MEM_ERROR; + } + php_http_error(HE_WARNING, PHP_HTTP_E_ENCODING, "Failed to copy deflate encoding stream: %s", zError(status)); + return NULL; } static php_http_encoding_stream_t *inflate_copy(php_http_encoding_stream_t *from, php_http_encoding_stream_t *to) { - z_streamp from_ctx = from->ctx, to_ctx = to->ctx; - - inflateCopy(to_ctx, from_ctx); - php_http_buffer_append(to_ctx->opaque, PHP_HTTP_BUFFER_VAL(from_ctx->opaque), PHP_HTTP_BUFFER_LEN(from_ctx->opaque)); + int status, p = from->flags & PHP_HTTP_ENCODING_STREAM_PERSISTENT; + z_streamp from_ctx = from->ctx, to_ctx = pecalloc(1, sizeof(*to_ctx), p); + TSRMLS_FETCH_FROM_CTX(from->ts); - return to; + if (Z_OK == (status = inflateCopy(to_ctx, from_ctx))) { + if ((to_ctx->opaque = php_http_buffer_init_ex(NULL, PHP_HTTP_DEFLATE_BUFFER_SIZE, p ? PHP_HTTP_BUFFER_INIT_PERSISTENT : 0))) { + php_http_buffer_append(to_ctx->opaque, PHP_HTTP_BUFFER_VAL(from_ctx->opaque), PHP_HTTP_BUFFER_LEN(from_ctx->opaque)); + to->ctx = to_ctx; + return to; + } + inflateEnd(to_ctx); + status = Z_MEM_ERROR; + } + php_http_error(HE_WARNING, PHP_HTTP_E_ENCODING, "Failed to copy inflate encoding stream: %s", zError(status)); + return NULL; } static php_http_encoding_stream_t *dechunk_copy(php_http_encoding_stream_t *from, php_http_encoding_stream_t *to) { - struct dechunk_ctx *from_ctx = from->ctx, *to_ctx = to->ctx; - - to_ctx->hexlen = from_ctx->hexlen; - to_ctx->zeroed = from_ctx->zeroed; - php_http_buffer_append(&to_ctx->buffer, PHP_HTTP_BUFFER_VAL(&from_ctx->buffer), PHP_HTTP_BUFFER_LEN(&from_ctx->buffer)); + int p = from->flags & PHP_HTTP_ENCODING_STREAM_PERSISTENT; + struct dechunk_ctx *from_ctx = from->ctx, *to_ctx = pemalloc(sizeof(*to_ctx), p); + TSRMLS_FETCH_FROM_CTX(from->ts); - return to; + if (php_http_buffer_init_ex(&to_ctx->buffer, PHP_HTTP_BUFFER_DEFAULT_SIZE, p ? PHP_HTTP_BUFFER_INIT_PERSISTENT : 0)) { + to_ctx->hexlen = from_ctx->hexlen; + to_ctx->zeroed = from_ctx->zeroed; + php_http_buffer_append(&to_ctx->buffer, PHP_HTTP_BUFFER_VAL(&from_ctx->buffer), PHP_HTTP_BUFFER_LEN(&from_ctx->buffer)); + to->ctx = to_ctx; + return to; + } + pefree(to_ctx, p); + php_http_error(HE_WARNING, PHP_HTTP_E_ENCODING, "Failed to copy inflate encoding stream: out of memory"); + return NULL; } static STATUS deflate_update(php_http_encoding_stream_t *s, const char *data, size_t data_len, char **encoded, size_t *encoded_len) @@ -480,7 +528,7 @@ static STATUS inflate_update(php_http_encoding_stream_t *s, const char *data, si /* append input to buffer */ php_http_buffer_append(PHP_HTTP_BUFFER(ctx->opaque), data, data_len); - + retry_raw_inflate: ctx->next_in = (Bytef *) PHP_HTTP_BUFFER_VAL(ctx->opaque); ctx->avail_in = PHP_HTTP_BUFFER_LEN(ctx->opaque); @@ -504,6 +552,7 @@ retry_raw_inflate: inflateInit2(ctx, PHP_HTTP_WINDOW_BITS_RAW); goto retry_raw_inflate; } + break; } php_http_error(HE_WARNING, PHP_HTTP_E_ENCODING, "Failed to update inflate stream: %s", zError(status)); @@ -512,17 +561,16 @@ retry_raw_inflate: static STATUS dechunk_update(php_http_encoding_stream_t *s, const char *data, size_t data_len, char **decoded, size_t *decoded_len) { - php_http_buffer tmp; + php_http_buffer_t tmp; struct dechunk_ctx *ctx = s->ctx; TSRMLS_FETCH_FROM_CTX(s->ts); if (ctx->zeroed) { + php_http_error(HE_WARNING, PHP_HTTP_E_ENCODING, "Dechunk encoding stream has already reached the end of chunked input"); return FAILURE; } - if (PHP_HTTP_BUFFER_NOMEM == php_http_buffer_append(&ctx->buffer, data, data_len)) { - return FAILURE; - } - if (!php_http_buffer_fix(&ctx->buffer)) { + if ((PHP_HTTP_BUFFER_NOMEM == php_http_buffer_append(&ctx->buffer, data, data_len)) || !php_http_buffer_fix(&ctx->buffer)) { + /* OOM */ return FAILURE; } @@ -598,6 +646,7 @@ static STATUS dechunk_update(php_http_encoding_stream_t *s, const char *data, si /* if strtoul() stops at the beginning of the buffered data there's domething oddly wrong, i.e. bad input */ if (stop == PHP_HTTP_BUFFER_VAL(&ctx->buffer)) { + php_http_error(HE_WARNING, PHP_HTTP_E_ENCODING, "Failed to parse chunk len from '%.*s'", MIN(16, ctx->buffer.used), ctx->buffer.data); php_http_buffer_dtor(&tmp); return FAILURE; } @@ -786,7 +835,7 @@ static void deflate_dtor(php_http_encoding_stream_t *s) z_streamp ctx = s->ctx; if (ctx->opaque) { - php_http_buffer_free((php_http_buffer **) &ctx->opaque); + php_http_buffer_free((php_http_buffer_t **) &ctx->opaque); } deflateEnd(ctx); pefree(ctx, (s->flags & PHP_HTTP_ENCODING_STREAM_PERSISTENT)); @@ -800,7 +849,7 @@ static void inflate_dtor(php_http_encoding_stream_t *s) z_streamp ctx = s->ctx; if (ctx->opaque) { - php_http_buffer_free((php_http_buffer **) &ctx->opaque); + php_http_buffer_free((php_http_buffer_t **) &ctx->opaque); } inflateEnd(ctx); pefree(ctx, (s->flags & PHP_HTTP_ENCODING_STREAM_PERSISTENT)); @@ -880,8 +929,14 @@ PHP_HTTP_EMPTY_ARGS(flush); PHP_HTTP_EMPTY_ARGS(done); PHP_HTTP_EMPTY_ARGS(finish); -zend_class_entry *php_http_encoding_stream_class_entry; -zend_function_entry php_http_encoding_stream_method_entry[] = { +static zend_class_entry *php_http_encoding_stream_class_entry; + +zend_class_entry *php_http_encoding_stream_get_class_entry(void) +{ + return php_http_encoding_stream_class_entry; +} + +static zend_function_entry php_http_encoding_stream_method_entry[] = { PHP_HTTP_ENCSTREAM_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) PHP_HTTP_ENCSTREAM_ME(update, ZEND_ACC_PUBLIC) PHP_HTTP_ENCSTREAM_ME(flush, ZEND_ACC_PUBLIC) @@ -936,7 +991,7 @@ void php_http_encoding_stream_object_free(void *object TSRMLS_DC) php_http_encoding_stream_object_t *o = (php_http_encoding_stream_object_t *) object; if (o->stream) { - php_http_encoding_stream_free(&o->stream TSRMLS_CC); + php_http_encoding_stream_free(&o->stream); } zend_object_std_dtor((zend_object *) o TSRMLS_CC); efree(o); @@ -944,21 +999,21 @@ void php_http_encoding_stream_object_free(void *object TSRMLS_DC) PHP_METHOD(HttpEncodingStream, __construct) { - with_error_handling(EH_THROW, PHP_HTTP_EX_CE(runtime)) { + with_error_handling(EH_THROW, php_http_exception_get_class_entry()) { long flags = 0; if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flags)) { - with_error_handling(EH_THROW, PHP_HTTP_EX_CE(encoding)) { + with_error_handling(EH_THROW, php_http_exception_get_class_entry()) { php_http_encoding_stream_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC); if (!obj->stream) { php_http_encoding_stream_ops_t *ops = NULL; - if (instanceof_function(obj->zo.ce, php_http_deflate_stream_class_entry TSRMLS_CC)) { + if (instanceof_function(obj->zo.ce, php_http_deflate_stream_get_class_entry() TSRMLS_CC)) { ops = &php_http_encoding_deflate_ops; - } else if (instanceof_function(obj->zo.ce, php_http_inflate_stream_class_entry TSRMLS_CC)) { + } else if (instanceof_function(obj->zo.ce, php_http_inflate_stream_get_class_entry() TSRMLS_CC)) { ops = &php_http_encoding_inflate_ops; - } else if (instanceof_function(obj->zo.ce, php_http_dechunk_stream_class_entry TSRMLS_CC)) { + } else if (instanceof_function(obj->zo.ce, php_http_dechunk_stream_get_class_entry() TSRMLS_CC)) { ops = &php_http_encoding_dechunk_ops; } @@ -988,7 +1043,7 @@ PHP_METHOD(HttpEncodingStream, update) size_t encoded_len; char *encoded_str; - if (SUCCESS == php_http_encoding_stream_update(obj->stream, data_str, data_len, &encoded_str, &encoded_len TSRMLS_CC)) { + if (SUCCESS == php_http_encoding_stream_update(obj->stream, data_str, data_len, &encoded_str, &encoded_len)) { RETURN_STRINGL(encoded_str, encoded_len, 0); } } @@ -1005,7 +1060,7 @@ PHP_METHOD(HttpEncodingStream, flush) char *encoded_str; size_t encoded_len; - if (SUCCESS == php_http_encoding_stream_flush(obj->stream, &encoded_str, &encoded_len TSRMLS_CC)) { + if (SUCCESS == php_http_encoding_stream_flush(obj->stream, &encoded_str, &encoded_len)) { RETURN_STRINGL(encoded_str, encoded_len, 0); } } @@ -1034,9 +1089,13 @@ PHP_METHOD(HttpEncodingStream, finish) char *encoded_str; size_t encoded_len; - if (SUCCESS == php_http_encoding_stream_finish(obj->stream, &encoded_str, &encoded_len TSRMLS_CC)) { + if (SUCCESS == php_http_encoding_stream_finish(obj->stream, &encoded_str, &encoded_len)) { if (SUCCESS == php_http_encoding_stream_reset(&obj->stream)) { - RETURN_STRINGL(encoded_str, encoded_len, 0); + if (encoded_str) { + RETURN_STRINGL(encoded_str, encoded_len, 0); + } else { + RETURN_EMPTY_STRING(); + } } else { STR_FREE(encoded_str); } @@ -1057,8 +1116,14 @@ PHP_HTTP_BEGIN_ARGS(encode, 1) PHP_HTTP_ARG_VAL(flags, 0) PHP_HTTP_END_ARGS; -zend_class_entry *php_http_deflate_stream_class_entry; -zend_function_entry php_http_deflate_stream_method_entry[] = { +static zend_class_entry *php_http_deflate_stream_class_entry; + +zend_class_entry *php_http_deflate_stream_get_class_entry(void) +{ + return php_http_deflate_stream_class_entry; +} + +static zend_function_entry php_http_deflate_stream_method_entry[] = { PHP_HTTP_DEFLATE_ME(encode, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) EMPTY_FUNCTION_ENTRY @@ -1091,8 +1156,14 @@ PHP_HTTP_BEGIN_ARGS(decode, 1) PHP_HTTP_ARG_VAL(data, 0) PHP_HTTP_END_ARGS; -zend_class_entry *php_http_inflate_stream_class_entry; -zend_function_entry php_http_inflate_stream_method_entry[] = { +static zend_class_entry *php_http_inflate_stream_class_entry; + +zend_class_entry *php_http_inflate_stream_get_class_entry(void) +{ + return php_http_inflate_stream_class_entry; +} + +static zend_function_entry php_http_inflate_stream_method_entry[] = { PHP_HTTP_INFLATE_ME(decode, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) EMPTY_FUNCTION_ENTRY @@ -1125,8 +1196,14 @@ PHP_HTTP_BEGIN_ARGS(decode, 1) PHP_HTTP_ARG_VAL(decoded_len, 1) PHP_HTTP_END_ARGS; -zend_class_entry *php_http_dechunk_stream_class_entry; -zend_function_entry php_http_dechunk_stream_method_entry[] = { +static zend_class_entry *php_http_dechunk_stream_class_entry; + +zend_class_entry *php_http_dechunk_stream_get_class_entry(void) +{ + return php_http_dechunk_stream_class_entry; +} + +static zend_function_entry php_http_dechunk_stream_method_entry[] = { PHP_HTTP_DECHUNK_ME(decode, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) EMPTY_FUNCTION_ENTRY @@ -1136,7 +1213,7 @@ PHP_METHOD(HttpDechunkStream, decode) { char *str; int len; - zval *zlen; + zval *zlen = NULL; if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z!", &str, &len, &zlen)) { const char *end_ptr; @@ -1156,7 +1233,7 @@ PHP_METHOD(HttpDechunkStream, decode) PHP_MINIT_FUNCTION(http_encoding) { - PHP_HTTP_REGISTER_CLASS(http\\encoding, Stream, http_encoding_stream, php_http_object_class_entry, ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); + PHP_HTTP_REGISTER_CLASS(http\\Encoding, Stream, http_encoding_stream, php_http_object_get_class_entry(), ZEND_ACC_EXPLICIT_ABSTRACT_CLASS); php_http_encoding_stream_class_entry->create_object = php_http_encoding_stream_object_new; memcpy(&php_http_encoding_stream_object_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers)); php_http_encoding_stream_object_handlers.clone_obj = php_http_encoding_stream_object_clone; @@ -1165,7 +1242,7 @@ PHP_MINIT_FUNCTION(http_encoding) zend_declare_class_constant_long(php_http_encoding_stream_class_entry, ZEND_STRL("FLUSH_SYNC"), PHP_HTTP_ENCODING_STREAM_FLUSH_SYNC TSRMLS_CC); zend_declare_class_constant_long(php_http_encoding_stream_class_entry, ZEND_STRL("FLUSH_FULL"), PHP_HTTP_ENCODING_STREAM_FLUSH_FULL TSRMLS_CC); - PHP_HTTP_REGISTER_CLASS(http\\encoding\\stream, Deflate, http_deflate_stream, php_http_encoding_stream_class_entry, 0); + PHP_HTTP_REGISTER_CLASS(http\\Encoding\\Stream, Deflate, http_deflate_stream, php_http_encoding_stream_class_entry, 0); zend_declare_class_constant_long(php_http_deflate_stream_class_entry, ZEND_STRL("TYPE_GZIP"), PHP_HTTP_DEFLATE_TYPE_GZIP TSRMLS_CC); zend_declare_class_constant_long(php_http_deflate_stream_class_entry, ZEND_STRL("TYPE_ZLIB"), PHP_HTTP_DEFLATE_TYPE_ZLIB TSRMLS_CC); @@ -1179,8 +1256,8 @@ PHP_MINIT_FUNCTION(http_encoding) zend_declare_class_constant_long(php_http_deflate_stream_class_entry, ZEND_STRL("STRATEGY_RLE"), PHP_HTTP_DEFLATE_STRATEGY_RLE TSRMLS_CC); zend_declare_class_constant_long(php_http_deflate_stream_class_entry, ZEND_STRL("STRATEGY_FIXED"), PHP_HTTP_DEFLATE_STRATEGY_FIXED TSRMLS_CC); - PHP_HTTP_REGISTER_CLASS(http\\encoding\\stream, Inflate, http_inflate_stream, php_http_encoding_stream_class_entry, 0); - PHP_HTTP_REGISTER_CLASS(http\\encoding\\stream, Dechunk, http_dechunk_stream, php_http_encoding_stream_class_entry, 0); + PHP_HTTP_REGISTER_CLASS(http\\Encoding\\Stream, Inflate, http_inflate_stream, php_http_encoding_stream_class_entry, 0); + PHP_HTTP_REGISTER_CLASS(http\\Encoding\\Stream, Dechunk, http_dechunk_stream, php_http_encoding_stream_class_entry, 0); return SUCCESS; }