For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > April 2007 > cvs: php-src / NEWS /ext/zlib zlib.c









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author cvs: php-src / NEWS /ext/zlib zlib.c
Michael Wallner

2007-04-18, 6:59 pm

mike Wed Apr 18 19:39:12 2007 UTC

Modified files:
/php-src/ext/zlib zlib.c
/php-src NEWS
Log:
- fixed bug #40325 (Vary: header missing in gzip output handlers); no MFH
[DOC] since PHP 6 a Vary header will be sent without regards to whether
the negotiation was successful or not and unless the complete
output buffer gets discarded


http://cvs.php.net/viewvc.cgi/php-s...5&diff_format=u
Index: php-src/ext/zlib/zlib.c
diff -u php-src/ext/zlib/zlib.c:1.214 php-src/ext/zlib/zlib.c:1.215
--- php-src/ext/zlib/zlib.c:1.214 Fri Feb 2 17:11:10 2007
+++ php-src/ext/zlib/zlib.c Wed Apr 18 19:39:12 2007
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/

-/* $Id: zlib.c,v 1.214 2007/02/02 17:11:10 mike Exp $ */
+/* $Id: zlib.c,v 1.215 2007/04/18 19:39:12 mike Exp $ */

#ifdef HAVE_CONFIG_H
# include "config.h"
@@ -124,6 +124,19 @@
PHP_OUTPUT_TSRMLS(output_context);

if (!php_zlib_output_encoding(TSRMLS_C)) {
+ /* "Vary: Accept-Encoding" header sent along uncompressed content breaks caching in MSIE,
+ so let's just send it with successfully compressed content or unless the complete
+ buffer gets discarded, see http://bugs.php.net/40325;
+
+ Test as follows:
+ +Vary: $ HTTP_ACCEPT_ENCODING=gzip ./sapi/cgi/php <<<'<?php ob_start("ob_gzhandler"); echo "foo\n";'
+ +Vary: $ HTTP_ACCEPT_ENCODING= ./sapi/cgi/php <<<'<?php ob_start("ob_gzhandler"); echo "foo\n";'
+ -Vary: $ HTTP_ACCEPT_ENCODING=gzip ./sapi/cgi/php <<<'<?php ob_start("ob_gzhandler"); echo "foo\n"; ob_end_clean();'
+ -Vary: $ HTTP_ACCEPT_ENCODING= ./sapi/cgi/php <<<'<?php ob_start("ob_gzhandler"); echo "foo\n"; ob_end_clean();'
+ */
+ if (output_context->op != (PHP_OUTPUT_HANDLER_START|PHP_OUTPUT_HAN
DLER_CLEAN|PHP_OUTPUT_HANDLER_FINAL)) {
+ sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 1 TSRMLS_CC);
+ }
return FAILURE;
}

@@ -218,8 +231,6 @@
deflateEnd(&ctx->Z);
return FAILURE;
}
- /* "Vary: Accept-Encoding" header sent along uncompressed content breaks caching in MSIE,
- so let's just send it with successfully compressed content, see http://bugs.php.net/40325 */
sapi_add_header_ex(ZEND_STRL("Vary: Accept-Encoding"), 1, 1 TSRMLS_CC);
php_output_handler_hook(PHP_OUTPUT_HANDL
ER_HOOK_IMMUTABLE, NULL TSRMLS_CC);
}
http://cvs.php.net/viewvc.cgi/php-s...5&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2144 php-src/NEWS:1.2145
--- php-src/NEWS:1.2144 Tue Apr 3 06:56:39 2007
+++ php-src/NEWS Wed Apr 18 19:39:12 2007
@@ -61,4 +61,4 @@
- Added str_getcsv() function. (Sara)
- Added ext/hash support to ext/session's ID generator. (Sara)

-
+- Fixed bug #40325 (Vary: header missing in gzip output handlers). (Mike)
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com