From: Thies C. Arntzen Date: Thu, 1 Feb 2001 17:14:18 +0000 (+0000) Subject: @- When using the ob_gzhandler() PHP now automagically also sets the X-Git-Tag: php-4.0.5RC1~398 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1366f67d0b1bbe52796aa5f7080a0e5cde90e688;p=php @- When using the ob_gzhandler() PHP now automagically also sets the @ Content-Lengh correctly which enables browsers to use the HTTP @ Keep-Alive feature. (Thies) --- diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index ed8299e6d0..59b370d18b 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -1115,8 +1115,14 @@ PHP_FUNCTION(ob_gzhandler) return_original = 1; break; } + if (return_original) { zval_dtor(return_value); + } else { + char lenbuf[ 64 ]; + + sprintf(lenbuf,"Content-Length: %d",Z_STRLEN_P(return_value)); + sapi_add_header(lenbuf,strlen(lenbuf), 1); } } else { return_original = 1;