- no fatal ereallocs please
[m6w6/ext-http] / http_encoding_api.c
index a31b5b79772cc0533c2af23274674cdb158db89d..c0d1140d4d452f5e0d304caea652959836709c1d 100644 (file)
@@ -467,7 +467,7 @@ PHP_HTTP_API STATUS _http_encoding_deflate_stream_flush(http_encoding_stream *s,
 {
        int status;
        
-       *encoded_len = 0x800;
+       *encoded_len = 0x8000;
        *encoded = emalloc_rel(*encoded_len);
        
        s->stream.avail_in = 0;
@@ -479,7 +479,7 @@ PHP_HTTP_API STATUS _http_encoding_deflate_stream_flush(http_encoding_stream *s,
        {
                case Z_OK:
                case Z_STREAM_END:
-                       *encoded_len = 0x800 - s->stream.avail_out;
+                       *encoded_len = 0x8000 - s->stream.avail_out;
                        *encoded = erealloc_rel(*encoded, *encoded_len + 1);
                        (*encoded)[*encoded_len] = '\0';
                        return SUCCESS;
@@ -503,7 +503,7 @@ PHP_HTTP_API STATUS _http_encoding_deflate_stream_finish(http_encoding_stream *s
 {
        int status;
        
-       *encoded_len = 0x800;
+       *encoded_len = 0x8000;
        *encoded = emalloc_rel(*encoded_len);
        
        /* deflate remaining input */
@@ -538,7 +538,7 @@ PHP_HTTP_API STATUS _http_encoding_inflate_stream_finish(http_encoding_stream *s
 {
        int status;
        
-       *decoded_len = s->stream.avail_in << 2;
+       *decoded_len = PHPSTR_LEN(s->stream.opaque) << 2;
        *decoded = emalloc_rel(*decoded_len);
        
        /* inflate remaining input */