From: Michael Wallner Date: Wed, 16 May 2007 19:26:26 +0000 (+0000) Subject: - libevent diagnostics X-Git-Tag: RELEASE_1_6_0b1~20 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=6c4a552c1ad7b0018afb57a3d0028c2be166a30a;p=m6w6%2Fext-http - libevent diagnostics --- diff --git a/config9.m4 b/config9.m4 index e0147dd..bebb5a7 100644 --- a/config9.m4 +++ b/config9.m4 @@ -288,6 +288,19 @@ dnl ---- AC_MSG_WARN([continuing without libevent support]) else AC_MSG_RESULT([found in $EVENT_DIR]) + + AC_MSG_CHECKING([for libevent version, roughly]) + EVENT_VER="1.1b or lower" + if test -f "$EVENT_DIR/include/evhttp.h" && test -f "$EVENT_DIR/include/evdns.h"; then + if test -f "$EVENT_DIR/include/evrpc.h"; then + EVENT_VER="1.4 or greater" + else + EVENT_VER="1.2 or greater" + fi + fi + AC_DEFINE_UNQUOTED([HTTP_EVENT_VERSION], ["$EVENT_VER"], [ ]) + AC_MSG_RESULT([$EVENT_VER]) + AC_MSG_CHECKING([for libcurl version >= 7.16.0]) AC_MSG_RESULT([$CURL_VERSION]) if test `echo $CURL_VERSION | $SED -e 's/[[^0-9]]/ /g' | $AWK '{print $1*10000 + $2*100 + $3}'` -lt 71600; then diff --git a/http.c b/http.c index f6b2118..923748d 100644 --- a/http.c +++ b/http.c @@ -454,6 +454,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 diff --git a/http_api.c b/http_api.c index 138b08e..61de3e8 100644 --- a/http_api.c +++ b/http_api.c @@ -32,6 +32,7 @@ PHP_MINIT_FUNCTION(http_support) HTTP_LONG_CONSTANT("HTTP_SUPPORT_MAGICMIME", HTTP_SUPPORT_MAGICMIME); HTTP_LONG_CONSTANT("HTTP_SUPPORT_ENCODINGS", HTTP_SUPPORT_ENCODINGS); HTTP_LONG_CONSTANT("HTTP_SUPPORT_SSLREQUESTS", HTTP_SUPPORT_SSLREQUESTS); + HTTP_LONG_CONSTANT("HTTP_SUPPORT_EVENTS", HTTP_SUPPORT_EVENTS); HTTP_LONG_CONSTANT("HTTP_PARAMS_ALLOW_COMMA", HTTP_PARAMS_ALLOW_COMMA); HTTP_LONG_CONSTANT("HTTP_PARAMS_ALLOW_FAILURE", HTTP_PARAMS_ALLOW_FAILURE); @@ -50,6 +51,9 @@ PHP_HTTP_API long _http_support(long feature) # ifdef HTTP_HAVE_SSL support |= HTTP_SUPPORT_SSLREQUESTS; # endif +# ifdef HTTP_HAVE_EVENT + support |= HTTP_SUPPORT_EVENTS; +# endif #endif #ifdef HTTP_HAVE_MAGIC support |= HTTP_SUPPORT_MAGICMIME; diff --git a/php_http_api.h b/php_http_api.h index 2de5abb..b8af494 100644 --- a/php_http_api.h +++ b/php_http_api.h @@ -21,6 +21,7 @@ #define HTTP_SUPPORT_ENCODINGS 0x08L #define HTTP_SUPPORT_SSLREQUESTS 0x20L #define HTTP_SUPPORT_PERSISTENCE 0x40L +#define HTTP_SUPPORT_EVENTS 0x80L #define HTTP_PARAMS_ALLOW_COMMA 0x01 #define HTTP_PARAMS_ALLOW_FAILURE 0x02 diff --git a/tests/HttpRequestPool_007.phpt b/tests/HttpRequestPool_007.phpt index 2105d49..8e97d40 100644 --- a/tests/HttpRequestPool_007.phpt +++ b/tests/HttpRequestPool_007.phpt @@ -5,8 +5,7 @@ HttpRequestPool chain with libevent include 'skip.inc'; checkcls('HttpRequest'); checkcls('HttpRequestPool'); -$pool = new RequestPool; -skipif(!@$pool->enableEvents(), "need libevent support"); +skipif(!http_support(HTTP_SUPPORT_EVENTS), "need libevent support"); ?> --FILE--