cvs: php4 /ext/zlib zlib.c
| From: | Stefan Roehrich | Date: | Sun, 02 Jun 2002 21:35:07 +0000 |
| Subject: | cvs: php4 /ext/zlib zlib.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-12200@lists.php.net to get a copy of this message | ||
sr Sun Jun 2 17:35:07 2002 EDT
Modified files:
/php4/ext/zlib zlib.c
Log:
Added "Vary: Accept-Encoding" header to zlib.output_compression
compressed output as with obgzhandler().
@ If zlib.output_compression is enabled and a page is compressed
@ a "Vary: Accept-Encoding" header is added. (Stefan)
# obgzhandler() sends this header, I think it is recommened by
# RFC 2616. If there are problems (e.g. with some browsers)
# it should be reverted.
Index: php4/ext/zlib/zlib.c
diff -u php4/ext/zlib/zlib.c:1.133 php4/ext/zlib/zlib.c:1.134
--- php4/ext/zlib/zlib.c:1.133 Wed May 1 21:11:58 2002
+++ php4/ext/zlib/zlib.c Sun Jun 2 17:35:06 2002
@@ -18,7 +18,7 @@
| Jade Nicoletti <nicoletti@nns.ch> |
+----------------------------------------------------------------------+
*/
-/* $Id: zlib.c,v 1.133 2002/05/02 01:11:58 yohgaki Exp $ */
+/* $Id: zlib.c,v 1.134 2002/06/02 21:35:06 sr Exp $ */
#define IS_EXT_MODULE
#ifdef HAVE_CONFIG_H
@@ -971,10 +971,16 @@
if (sapi_add_header("Content-Encoding: gzip", sizeof("Content-Encoding:
gzip") - 1, 1)==FAILURE) {
return FAILURE;
}
+ if (sapi_add_header("Vary: Accept-Encoding", sizeof("Vary: Accept-Encoding")
- 1, 1)==FAILURE) {
+ return FAILURE;
+ }
ZLIBG(ob_gzip_coding) = CODING_GZIP;
} else if(php_memnstr(Z_STRVAL_PP(a_encoding), "deflate", 7, Z_STRVAL_PP(a_encoding) +
Z_STRLEN_PP(a_encoding))) {
if (sapi_add_header("Content-Encoding: deflate", sizeof("Content-Encoding:
deflate") - 1, 1)==FAILURE) {
return FAILURE;
+ }
+ if (sapi_add_header("Vary: Accept-Encoding", sizeof("Vary: Accept-Encoding")
- 1, 1)==FAILURE) {
+ return FAILURE;
}
ZLIBG(ob_gzip_coding) = CODING_DEFLATE;
} else {