Add support for CURLINFO_CONN_ID in curl_getinfo() (#18984)

This patch adds support for the CURLINFO_CONN_ID constant in the curl_getinfo() function when compiled with libcurl >= 8.2.0.

CURLINFO_CONN_ID allows retrieving the unique identifier of the underlying connection used in the most recent transfer. This is useful for advanced features like connection reuse tracking, diagnostics, or connection pooling implementations at the PHP level.
This commit is contained in:
Emre Çalışkan 2025-07-16 12:08:19 +03:00 committed by GitHub
parent 2ecafd41ba
commit e84320ad75
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 168 additions and 1 deletions

View file

@ -2622,6 +2622,11 @@ PHP_FUNCTION(curl_getinfo)
if (curl_easy_getinfo(ch->cp, CURLINFO_PROXYAUTH_USED, &l_code) == CURLE_OK) {
CAAL("proxyauth_used", l_code);
}
#endif
#if LIBCURL_VERSION_NUM >= 0x080200 /* Available since 8.2.0 */
if (curl_easy_getinfo(ch->cp, CURLINFO_CONN_ID , &co) == CURLE_OK) {
CAAL("conn_id", co);
}
#endif
} else {
switch (option) {