X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=http_request_info.c;fp=http_request_info.c;h=b817841e84174297544f6d89621b758f812b0352;hb=375522dcffba5c1f2d99ff70afb2a8f8788063cd;hp=809512ade05d1ed6510a4f66679513b38c94fc37;hpb=741dcad23a199544321618b66bf0d2a95217f639;p=m6w6%2Fext-http diff --git a/http_request_info.c b/http_request_info.c index 809512a..b817841 100644 --- a/http_request_info.c +++ b/http_request_info.c @@ -148,6 +148,21 @@ PHP_HTTP_API void _http_request_info(http_request *request, HashTable *info) add_assoc_long_ex(&array, "condition_unmet", sizeof("condition_unmet"), l); } #endif +#if HTTP_CURL_VERSION(7,21,0) + if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_PRIMARY_PORT, &l)) { + add_assoc_long_ex(&array, "primary_port", sizeof("primary_port"), l); + } +#endif +#if HTTP_CURL_VERSION(7,21,0) + if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_LOCAL_IP, &c)) { + add_assoc_string_ex(&array, "local_ip", sizeof("local_ip"), c ? c : "", 1); + } +#endif +#if HTTP_CURL_VERSION(7,21,0) + if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_LOCAL_PORT, &l)) { + add_assoc_long_ex(&array, "local_port", sizeof("local_port"), l); + } +#endif /* END */ #if HTTP_CURL_VERSION(7,19,1) && defined(HTTP_HAVE_OPENSSL) {