X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_response_object.c;h=a617c9f1c942b7dc3884a3f9f24c757ebef01bc1;hp=72289b65f291fc71025eb04262abb32fdd03695c;hb=47d531af5faac1df8dedeb383867850ab430f0a1;hpb=798fddb0eb9be9f784a0a93443ec8eb0aca82e61 diff --git a/http_response_object.c b/http_response_object.c index 72289b6..a617c9f 100644 --- a/http_response_object.c +++ b/http_response_object.c @@ -214,10 +214,11 @@ zend_function_entry http_response_object_fe[] = { EMPTY_FUNCTION_ENTRY }; -void _http_response_object_init(INIT_FUNC_ARGS) +PHP_MINIT_FUNCTION(http_response_object) { HTTP_REGISTER_CLASS(HttpResponse, http_response_object, NULL, 0); http_response_object_declare_default_properties(); + return SUCCESS; } static inline void _http_response_object_declare_default_properties(TSRMLS_D) @@ -1105,17 +1106,14 @@ PHP_METHOD(HttpResponse, send) } /* throttling */ - { - HTTP_G(send).buffer_size = Z_LVAL_P(convert_to_type_ex(IS_LONG, GET_STATIC_PROP(bufferSize))); - HTTP_G(send).throttle_delay = Z_DVAL_P(convert_to_type_ex(IS_DOUBLE, GET_STATIC_PROP(throttleDelay))); - } + HTTP_G(send).buffer_size = Z_LVAL_P(convert_to_type_ex(IS_LONG, GET_STATIC_PROP(bufferSize))); + HTTP_G(send).throttle_delay = Z_DVAL_P(convert_to_type_ex(IS_DOUBLE, GET_STATIC_PROP(throttleDelay))); /* gzip */ - if (zval_is_true(GET_STATIC_PROP(gzip))) { - php_start_ob_buffer_named("ob_gzhandler", HTTP_G(send).buffer_size, 0 TSRMLS_CC); - } else { - php_start_ob_buffer(NULL, HTTP_G(send).buffer_size, 0 TSRMLS_CC); - } + HTTP_G(send).gzip_encoding = zval_is_true(GET_STATIC_PROP(gzip)); + + /* start ob */ + php_start_ob_buffer(NULL, HTTP_G(send).buffer_size, 0 TSRMLS_CC); /* send */ switch (Z_LVAL_P(GET_STATIC_PROP(mode)))