summaryrefslogtreecommitdiff
path: root/ext/zlib/zlib.c
diff options
context:
space:
mode:
authorThies C. Arntzen <thies@php.net>2001-02-01 17:14:18 +0000
committerThies C. Arntzen <thies@php.net>2001-02-01 17:14:18 +0000
commit1366f67d0b1bbe52796aa5f7080a0e5cde90e688 (patch)
treef57b919e3b2c9bda6b37648e10c4d9685ad1a6d0 /ext/zlib/zlib.c
parenta4df53ad1ce3cc4b2d0d1f38bc8d7dd1cfa02da9 (diff)
downloadphp-git-1366f67d0b1bbe52796aa5f7080a0e5cde90e688.tar.gz
@- 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)
Diffstat (limited to 'ext/zlib/zlib.c')
-rw-r--r--ext/zlib/zlib.c6
1 files changed, 6 insertions, 0 deletions
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;