From: Michael Wallner Date: Mon, 1 Mar 2021 14:22:52 +0000 (+0100) Subject: add new curl_info entries X-Git-Tag: v4.1.0~31 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=52be96243430aa591233fdc021f838ec7abaf308;p=m6w6%2Fext-http add new curl_info entries --- diff --git a/scripts/gen_curlinfo.php b/scripts/gen_curlinfo.php index 0aa9c5e..bc4a683 100755 --- a/scripts/gen_curlinfo.php +++ b/scripts/gen_curlinfo.php @@ -39,6 +39,8 @@ $ifdefs = array( 'PROXY_SSL_VERIFYRESULT' => 'PHP_HTTP_CURL_VERSION(7,52,0)', 'PROTOCOL' => 'PHP_HTTP_CURL_VERSION(7,52,0)', 'SCHEME' => 'PHP_HTTP_CURL_VERSION(7,52,0)', + 'EFFECTIVE_METHOD' => 'PHP_HTTP_CURL_VERSION(7,72,0)', + 'PROXY_ERROR' => 'PHP_HTTP_CURL_VERSION(7,73,0)', ); $exclude = array( 'ACTIVESOCKET', diff --git a/src/php_http_client_curl.c b/src/php_http_client_curl.c index 8a28008..de8bc20 100644 --- a/src/php_http_client_curl.c +++ b/src/php_http_client_curl.c @@ -510,6 +510,18 @@ static ZEND_RESULT_CODE php_http_curle_get_info(CURL *ch, HashTable *info) zend_hash_str_update(info, "scheme", lenof("scheme"), &tmp); } #endif +#if PHP_HTTP_CURL_VERSION(7,72,0) + if (CURLE_OK == curl_easy_getinfo(ch, CURLINFO_EFFECTIVE_METHOD, &c)) { + ZVAL_STRING(&tmp, STR_PTR(c)); + zend_hash_str_update(info, "effective_method", lenof("effective_method"), &tmp); + } +#endif +#if PHP_HTTP_CURL_VERSION(7,73,0) + if (CURLE_OK == curl_easy_getinfo(ch, CURLINFO_PROXY_ERROR, &l)) { + ZVAL_LONG(&tmp, l); + zend_hash_str_update(info, "proxy_error", lenof("proxy_error"), &tmp); + } +#endif /* END::CURLINFO */