X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_request_info.c;h=db72fac7a3050cdd6e54cc6e375691531d78ffa9;hp=1d12f36d397f0e26ee05f2c0dbd44f310c251844;hb=c52642ccff4fe2887c9d5581816a7cae55766df4;hpb=d982551f5260407a6301c662604ac0b854fb7ba0 diff --git a/http_request_info.c b/http_request_info.c index 1d12f36..db72fac 100644 --- a/http_request_info.c +++ b/http_request_info.c @@ -124,6 +124,32 @@ PHP_HTTP_API void _http_request_info(http_request *request, HashTable *info) curl_slist_free_all(s); } #endif +#if HTTP_CURL_VERSION(7,18,2) + if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_REDIRECT_URL, &c)) { + add_assoc_string_ex(&array, "redirect_url", sizeof("redirect_url"), c ? c : "", 1); + } +#endif +#if HTTP_CURL_VERSION(7,19,0) + if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_PRIMARY_IP, &c)) { + add_assoc_string_ex(&array, "primary_ip", sizeof("primary_ip"), c ? c : "", 1); + } +#endif +#if HTTP_CURL_VERSION(7,19,0) + if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_APPCONNECT_TIME, &d)) { + add_assoc_double_ex(&array, "appconnect_time", sizeof("appconnect_time"), d); + } +#endif +#if HTTP_CURL_VERSION(7,19,1) && defined(HTTP_HAVE_OPENSSL) + if (CURLE_OK == curl_easy_getinfo(request->ch, CURLINFO_CERTINFO, &s)) { + MAKE_STD_ZVAL(subarray); + array_init(subarray); + for (p = s; p; p = p->next) { + add_next_index_string(subarray, p->data, 1); + } + add_assoc_zval_ex(&array, "certinfo", sizeof("certinfo"), subarray); + curl_slist_free_all(s); + } +#endif /* END */ add_assoc_string_ex(&array, "error", sizeof("error"), http_request_storage_get(request->ch)->errorbuffer, 1); }