X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_response_object.c;h=e255989e7fbcc21c4fb84b139cf0d0a4c7b4d218;hp=72289b65f291fc71025eb04262abb32fdd03695c;hb=656d8e1b62f2fd578b2b0943e6a09ac13bab4f70;hpb=798fddb0eb9be9f784a0a93443ec8eb0aca82e61 diff --git a/http_response_object.c b/http_response_object.c index 72289b6..e255989 100644 --- a/http_response_object.c +++ b/http_response_object.c @@ -1,16 +1,13 @@ /* - +----------------------------------------------------------------------+ - | PECL :: http | - +----------------------------------------------------------------------+ - | This source file is subject to version 3.0 of the PHP license, that | - | is bundled with this package in the file LICENSE, and is available | - | through the world-wide-web at http://www.php.net/license/3_0.txt. | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | license@php.net so we can mail you a copy immediately. | - +----------------------------------------------------------------------+ - | Copyright (c) 2004-2005 Michael Wallner | - +----------------------------------------------------------------------+ + +--------------------------------------------------------------------+ + | PECL :: http | + +--------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted provided that the conditions mentioned | + | in the accompanying LICENSE file are met. | + +--------------------------------------------------------------------+ + | Copyright (c) 2004-2005, Michael Wallner | + +--------------------------------------------------------------------+ */ /* $Id$ */ @@ -214,10 +211,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 +1103,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)))