/* {{{ 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;
#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;
}
/* }}} */
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);
}
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);
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;