From: Michael Wallner Date: Sun, 5 Nov 2006 18:22:31 +0000 (+0000) Subject: - add "ipresolve" request option X-Git-Tag: RELEASE_1_4_0RC1~24 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=7af57cc6167fbadcf861e0edcc0d44b9ae44dd5f;p=m6w6%2Fext-http - add "ipresolve" request option - add HTTP_IPRESOLVE_{ANY|V4|V6} HttpRequest::IPRESOLVE_{ANY|V4|V6} constants --- diff --git a/http_request_api.c b/http_request_api.c index b2f997b..ea63dfa 100644 --- a/http_request_api.c +++ b/http_request_api.c @@ -114,6 +114,10 @@ PHP_MINIT_FUNCTION(http_request) HTTP_LONG_CONSTANT("HTTP_VERSION_NONE", CURL_HTTP_VERSION_NONE); HTTP_LONG_CONSTANT("HTTP_VERSION_1_0", CURL_HTTP_VERSION_1_0); HTTP_LONG_CONSTANT("HTTP_VERSION_1_1", CURL_HTTP_VERSION_1_1); + + HTTP_LONG_CONSTANT("HTTP_IPRESOLVE_V4", CURL_IPRESOLVE_V4); + HTTP_LONG_CONSTANT("HTTP_IPRESOLVE_V6", CURL_IPRESOLVE_V6); + HTTP_LONG_CONSTANT("HTTP_IPRESOLVE_ANY", CURL_IPRESOLVE_WHATEVER); #if HTTP_CURL_VERSION(7,15,2) HTTP_LONG_CONSTANT("HTTP_PROXY_SOCKS4", CURLPROXY_SOCKS4); @@ -348,6 +352,7 @@ PHP_HTTP_API void _http_request_defaults(http_request *request) HTTP_CURL_OPT(CURLOPT_PROXYUSERPWD, NULL); HTTP_CURL_OPT(CURLOPT_PROXYAUTH, 0L); HTTP_CURL_OPT(CURLOPT_DNS_CACHE_TIMEOUT, 60L); + HTTP_CURL_OPT(CURLOPT_IPRESOLVE, 0); HTTP_CURL_OPT(CURLOPT_LOW_SPEED_LIMIT, 0L); HTTP_CURL_OPT(CURLOPT_LOW_SPEED_TIME, 0L); #if HTTP_CURL_VERSION(7,15,5) @@ -476,6 +481,9 @@ PHP_HTTP_API STATUS _http_request_prepare(http_request *request, HashTable *opti if ((zoption = http_request_option(request, options, "dns_cache_timeout", IS_LONG))) { HTTP_CURL_OPT(CURLOPT_DNS_CACHE_TIMEOUT, Z_LVAL_P(zoption)); } + if ((zoption = http_request_option(request, options, "ipresolve", IS_LONG)) && Z_LVAL_P(zoption)) { + HTTP_CURL_OPT(CURLOPT_IPRESOLVE, Z_LVAL_P(zoption)); + } /* limits */ if ((zoption = http_request_option(request, options, "low_speed_limit", IS_LONG))) { diff --git a/http_request_object.c b/http_request_object.c index b9e8af7..7e110b9 100644 --- a/http_request_object.c +++ b/http_request_object.c @@ -397,6 +397,13 @@ PHP_MINIT_FUNCTION(http_request_object) DCL_CONST(long, "VERSION_1_1", CURL_HTTP_VERSION_1_1); DCL_CONST(long, "VERSION_NONE", CURL_HTTP_VERSION_NONE); + /* + * DNS IPvX resolving + */ + DCL_CONST(long, "IPRESOLVE_V4", CURL_IPRESOLVE_V4); + DCL_CONST(long, "IPRESOLVE_V6", CURL_IPRESOLVE_V6); + DCL_CONST(long, "IPRESOLVE_ANY", CURL_IPRESOLVE_WHATEVER); + /* * Auth Constants */