X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http.c;h=a2ffaf9fa40f64554719467a61711dc0d797d902;hp=b4ed0dfbdcd06083c61ef621912b0900522ba7b6;hb=ad5f896b03adaa073134a00108a9cdf00720673a;hpb=2dc2f1f7e1142bc51fa5ac9e1004c56f9f82e47c diff --git a/http.c b/http.c index b4ed0df..a2ffaf9 100644 --- a/http.c +++ b/http.c @@ -6,7 +6,7 @@ | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ - | Copyright (c) 2004-2007, Michael Wallner | + | Copyright (c) 2004-2010, Michael Wallner | +--------------------------------------------------------------------+ */ @@ -14,6 +14,7 @@ #define HTTP_WANT_SAPI #define HTTP_WANT_CURL +#define HTTP_WANT_EVENT #define HTTP_WANT_ZLIB #define HTTP_WANT_MAGIC #include "php_http.h" @@ -140,6 +141,9 @@ static zend_module_dep http_module_deps[] = { # ifdef HTTP_HAVE_ICONV ZEND_MOD_REQUIRED("iconv") # endif +# ifdef HTTP_HAVE_EVENT + ZEND_MOD_CONFLICTS("event") +#endif {NULL, NULL, NULL, 0} }; #endif @@ -160,7 +164,7 @@ zend_module_entry http_module_entry = { PHP_RINIT(http), PHP_RSHUTDOWN(http), PHP_MINFO(http), - PHP_EXT_HTTP_VERSION, + PHP_HTTP_VERSION, STANDARD_MODULE_PROPERTIES }; /* }}} */ @@ -339,6 +343,7 @@ PHP_MSHUTDOWN_FUNCTION(http) || SUCCESS != PHP_MSHUTDOWN_CALL(http_request_datashare) # endif #endif + || SUCCESS != PHP_MSHUTDOWN_CALL(http_message_object) || SUCCESS != PHP_MSHUTDOWN_CALL(http_persistent_handle) /* last */ ) { return FAILURE; @@ -363,6 +368,9 @@ PHP_RINIT_FUNCTION(http) #endif #ifdef HTTP_HAVE_CURL # ifdef ZEND_ENGINE_2 +# ifdef HTTP_HAVE_EVENT + || SUCCESS != PHP_RINIT_CALL(http_request_pool) +# endif || SUCCESS != PHP_RINIT_CALL(http_request_datashare) # endif #endif @@ -404,8 +412,8 @@ PHP_MINFO_FUNCTION(http) { php_info_print_table_start(); { - php_info_print_table_row(2, "HTTP Support", "enabled"); - php_info_print_table_row(2, "Extension Version", PHP_EXT_HTTP_VERSION); + php_info_print_table_header(2, "HTTP Support", "enabled"); + php_info_print_table_row(2, "Extension Version", PHP_HTTP_VERSION); php_info_print_table_row(2, "Registered Classes", #ifndef ZEND_ENGINE_2 "none" @@ -447,6 +455,11 @@ PHP_MINFO_FUNCTION(http) #else php_info_print_table_row(2, "libcurl", "disabled", "disabled"); #endif +#ifdef HTTP_HAVE_EVENT + php_info_print_table_row(3, "libevent", HTTP_EVENT_VERSION, event_get_version()); +#else + php_info_print_table_row(3, "libevent", "disabled", "disabled"); +#endif #ifdef HTTP_HAVE_ZLIB php_info_print_table_row(3, "libz", ZLIB_VERSION, zlibVersion()); #else @@ -475,9 +488,11 @@ PHP_MINFO_FUNCTION(http) FOREACH_KEYVAL(pos2, *val, ident, sub) { if ( SUCCESS == zend_hash_find(Z_ARRVAL_PP(sub), ZEND_STRS("used"), (void *) &zused) && SUCCESS == zend_hash_find(Z_ARRVAL_PP(sub), ZEND_STRS("free"), (void *) &zfree)) { - convert_to_string(*zused); - convert_to_string(*zfree); - php_info_print_table_row(4, provider.str, ident.str, Z_STRVAL_PP(zused), Z_STRVAL_PP(zfree)); + zval *used = http_zsep(IS_STRING, *zused); + zval *free = http_zsep(IS_STRING, *zfree); + php_info_print_table_row(4, provider.str, ident.str, Z_STRVAL_P(used), Z_STRVAL_P(free)); + zval_ptr_dtor(&used); + zval_ptr_dtor(&free); } else { php_info_print_table_row(4, provider.str, ident.str, "0", "0"); }