cvs: php4 /ext/zlib zlib.c /main output.c
| From: | Zeev Suraski | Date: | Fri, 23 Aug 2002 08:37:35 +0000 |
| Subject: | cvs: php4 /ext/zlib zlib.c /main output.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-13590@lists.php.net to get a copy of this message | ||
zeev Fri Aug 23 04:37:35 2002 EDT
Modified files:
/php4/ext/zlib zlib.c
/php4/main output.c
Log:
Fix ob_gzhandler()'s handling of requests w/o compression but that do have
the Accept-Encoding header
Index: php4/ext/zlib/zlib.c
diff -u php4/ext/zlib/zlib.c:1.147 php4/ext/zlib/zlib.c:1.148
--- php4/ext/zlib/zlib.c:1.147 Thu Aug 22 13:37:46 2002
+++ php4/ext/zlib/zlib.c Fri Aug 23 04:37:34 2002
@@ -18,7 +18,7 @@
| Jade Nicoletti <nicoletti@nns.ch> |
+----------------------------------------------------------------------+
*/
-/* $Id: zlib.c,v 1.147 2002/08/22 17:37:46 wez Exp $ */
+/* $Id: zlib.c,v 1.148 2002/08/23 08:37:34 zeev Exp $ */
#define IS_EXT_MODULE
#ifdef HAVE_CONFIG_H
@@ -905,11 +905,8 @@
|| zend_hash_find(&EG(symbol_table), "HTTP_SERVER_VARS",
sizeof("HTTP_SERVER_VARS"), (void **) &data)==FAILURE
|| Z_TYPE_PP(data)!=IS_ARRAY
|| zend_hash_find(Z_ARRVAL_PP(data), "HTTP_ACCEPT_ENCODING",
sizeof("HTTP_ACCEPT_ENCODING"), (void **) &a_encoding)==FAILURE) {
- /* return the original string */
- *return_value = **zv_string;
- zval_copy_ctor(return_value);
ZLIBG(ob_gzhandler_status)=-1;
- return;
+ RETURN_FALSE;
}
convert_to_string_ex(a_encoding);
if (php_memnstr(Z_STRVAL_PP(a_encoding), "gzip", 4, Z_STRVAL_PP(a_encoding) +
Z_STRLEN_PP(a_encoding))) {
@@ -917,6 +914,7 @@
} else if(php_memnstr(Z_STRVAL_PP(a_encoding), "deflate", 7, Z_STRVAL_PP(a_encoding) +
Z_STRLEN_PP(a_encoding))) {
coding = CODING_DEFLATE;
} else {
+ ZLIBG(ob_gzhandler_status)=-1;
RETURN_FALSE;
}
Index: php4/main/output.c
diff -u php4/main/output.c:1.115 php4/main/output.c:1.116
--- php4/main/output.c:1.115 Thu Aug 22 06:52:40 2002
+++ php4/main/output.c Fri Aug 23 04:37:35 2002
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: output.c,v 1.115 2002/08/22 10:52:40 helly Exp $ */
+/* $Id: output.c,v 1.116 2002/08/23 08:37:35 zeev Exp $ */
#include "php.h"
#include "ext/standard/head.h"
@@ -247,9 +247,11 @@
params[1] = &z_status;
OG(ob_lock) = 1;
if (call_user_function_ex(CG(function_table), NULL, OG(active_ob_buffer).output_handler,
&alternate_buffer, 2, params, 1, NULL TSRMLS_CC)==SUCCESS) {
- convert_to_string_ex(&alternate_buffer);
- final_buffer = Z_STRVAL_P(alternate_buffer);
- final_buffer_length = Z_STRLEN_P(alternate_buffer);
+ if (!(Z_TYPE_P(alternate_buffer)==IS_BOOL && Z_BVAL_P(alternate_buffer)==0)) {
+ convert_to_string_ex(&alternate_buffer);
+ final_buffer = Z_STRVAL_P(alternate_buffer);
+ final_buffer_length = Z_STRLEN_P(alternate_buffer);
+ }
}
OG(ob_lock) = 0;
zval_ptr_dtor(&OG(active_ob_buffer).output_handler);