diff options
author | Yasuo Ohgaki <yohgaki@php.net> | 2002-05-02 01:12:01 +0000 |
---|---|---|
committer | Yasuo Ohgaki <yohgaki@php.net> | 2002-05-02 01:12:01 +0000 |
commit | 43df0c78c051c87d4cca21fafb09f02526e19f8d (patch) | |
tree | a9831a76089b6d848d71ad0914b7df1bd8778639 /ext | |
parent | f46c1527750f4aa9e307e9ce0623d94c25a784e6 (diff) | |
download | php-git-43df0c78c051c87d4cca21fafb09f02526e19f8d.tar.gz |
Move Content-Length: header handling from zlib.c to output.c
When output buffer is enabled and header can be sent, Content-Length:
header is added always from now on.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/zlib/zlib.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index d109debea1..f69a570b0c 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -73,17 +73,6 @@ #endif #endif -#include "ext/standard/php_smart_str.h" - -#define ADD_CL_HEADER(xln) do { \ - smart_str str = {0}; \ - \ - smart_str_appends(&str, "Content-Length: "); \ - smart_str_append_long(&str, xln); \ - smart_str_0(&str); \ - sapi_add_header(str.c, str.len, 0); \ - } while(0) - #define OS_CODE 0x03 /* FIXME */ #define CODING_GZIP 1 #define CODING_DEFLATE 2 @@ -938,9 +927,8 @@ PHP_FUNCTION(ob_gzhandler) if (return_original) { zval_dtor(return_value); - } else if (do_start && do_end) - ADD_CL_HEADER(Z_STRLEN_P(return_value)); - + } + } else { return_original = 1; } @@ -963,10 +951,7 @@ static void php_gzip_output_handler(char *output, uint output_len, char **handle do_end = (mode & PHP_OUTPUT_HANDLER_END ? 1 : 0); if (php_deflate_string(output, output_len, handled_output, handled_output_len, ZLIBG(ob_gzip_coding), do_start, do_end, ZLIBG(output_compression_level) TSRMLS_CC)!=SUCCESS) { zend_error(E_ERROR, "Compression failed"); - } else { - if (do_start && do_end) - ADD_CL_HEADER(*handled_output_len); - } + } } /* }}} */ |