- fix compiler warnings
authorMichael Wallner <mike@php.net>
Mon, 25 Sep 2006 13:32:03 +0000 (13:32 +0000)
committerMichael Wallner <mike@php.net>
Mon, 25 Sep 2006 13:32:03 +0000 (13:32 +0000)
http_encoding_api.c
http_querystring_object.c
http_requestdatashare_object.c

index 1975295c00e5a36056473f4c65cf96964f66fa8c..0de420a81a89fbf41fdfd744e937dc598afc916b 100644 (file)
@@ -160,11 +160,12 @@ PHP_HTTP_API const char *_http_encoding_dechunk(const char *encoded, size_t enco
 /* {{{ int http_encoding_response_start(size_t) */
 PHP_HTTP_API int _http_encoding_response_start(size_t content_length TSRMLS_DC)
 {
-       if (    php_ob_handler_used("ob_gzhandler" TSRMLS_CC) ||
-                       php_ob_handler_used("zlib output compression" TSRMLS_CC)) {
-               HTTP_G->send.deflate.encoding = 0;
-       } else if (HTTP_G->send.deflate.encoding) {
-               HTTP_G->send.deflate.encoding = 0;
+       int is_http = HTTP_G->send.deflate.encoding;
+       int is_zlib = php_ob_handler_used("ob_gzhandler" TSRMLS_CC) || php_ob_handler_used("zlib output compression" TSRMLS_CC);
+       
+       HTTP_G->send.deflate.encoding = 0;
+       
+       if (is_http && !is_zlib) {
 #ifdef HTTP_HAVE_ZLIB
                HashTable *selected;
                zval zsupported;
@@ -203,16 +204,14 @@ PHP_HTTP_API int _http_encoding_response_start(size_t content_length TSRMLS_DC)
 #else
                php_start_ob_buffer_named("ob_gzhandler", 0, 0 TSRMLS_CC);
 #endif /* HTTP_HAVE_ZLIB */
-       } else {
-               HTTP_G->send.deflate.encoding = 0;
-               if (content_length) {
-                       /* emit a content-length header */
-                       char cl_header_str[128];
-                       size_t cl_header_len;
-                       cl_header_len = snprintf(cl_header_str, lenof(cl_header_str), "Content-Length: %zu", content_length);
-                       http_send_header_string_ex(cl_header_str, cl_header_len, 1);
-               }
+       } else if (content_length && !is_zlib) {
+               /* emit a content-length header */
+               char cl_header_str[128];
+               size_t cl_header_len;
+               cl_header_len = snprintf(cl_header_str, lenof(cl_header_str), "Content-Length: %zu", content_length);
+               http_send_header_string_ex(cl_header_str, cl_header_len, 1);
        }
+       
        return HTTP_G->send.deflate.encoding;
 }
 /* }}} */
index 7dfabe3aee11db1c7f508af6bf21de5353e1ed2f..68d6e27b8f2ed4dbb8eb7a5c654635253d4c60bf 100644 (file)
@@ -440,7 +440,7 @@ PHP_METHOD(HttpQueryString, singleton)
                        if (SUCCESS == zend_hash_index_find(Z_ARRVAL_P(instance), global, (void *) &zobj_ptr)) {
                                RETVAL_ZVAL(*zobj_ptr, 1, 0);
                        } else {
-                               zobj = http_querystring_instantiate(NULL, global, NULL, !global);
+                               zobj = http_querystring_instantiate(NULL, global, NULL, (zend_bool) !global);
                                add_index_zval(instance, global, zobj);
                                RETVAL_OBJECT(zobj, 1);
                        }
@@ -448,7 +448,7 @@ PHP_METHOD(HttpQueryString, singleton)
                        MAKE_STD_ZVAL(instance);
                        array_init(instance);
                        
-                       zobj = http_querystring_instantiate(NULL, global, NULL, !global);
+                       zobj = http_querystring_instantiate(NULL, global, NULL, (zend_bool) !global);
                        add_index_zval(instance, global, zobj);
                        RETVAL_OBJECT(zobj, 1);
                        
index af8e9d49426f0ee0d80b18c8dbb273f748510936..46299e6b965a1bdb12728ffe113b4d56cb7b5521 100644 (file)
@@ -157,7 +157,7 @@ static void _http_requestdatashare_object_write_prop(zval *object, zval *member,
                getObjectEx(http_requestdatashare_object, obj, object);
                
                SEPARATE_ZVAL_IF_NOT_REF(&value);
-               status = http_request_datashare_set(obj->share, Z_STRVAL_P(member), Z_STRLEN_P(member), zval_is_true(value));
+               status = http_request_datashare_set(obj->share, Z_STRVAL_P(member), Z_STRLEN_P(member), (zend_bool) zval_is_true(value));
                if (orig != value) {
                        zval_ptr_dtor(&value);
                        value = orig;