From 3df0f0a82217c339e47301a49771e2881bf3b0e2 Mon Sep 17 00:00:00 2001
From: Petr Shumilov
Date: Thu, 27 Nov 2025 12:03:05 +0300
Subject: [PATCH] Mark CURLINFO_NUM_CONNECTS as unsupported but available info
option
Signed-off-by: Petr Shumilov
---
builtin-functions/kphp-light/stdlib/curl-functions.txt | 2 +-
runtime-light/stdlib/curl/curl-easy-functions.h | 5 ++++-
runtime-light/stdlib/curl/defs.h | 1 +
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/builtin-functions/kphp-light/stdlib/curl-functions.txt b/builtin-functions/kphp-light/stdlib/curl-functions.txt
index 0a98fc3efd..ee7297d544 100644
--- a/builtin-functions/kphp-light/stdlib/curl-functions.txt
+++ b/builtin-functions/kphp-light/stdlib/curl-functions.txt
@@ -31,7 +31,7 @@ define('CURLINFO_HTTP_CONNECTCODE', 2097174);
// define('CURLINFO_HTTPAUTH_AVAIL', 100027);
// define('CURLINFO_PROXYAUTH_AVAIL', 100028);
define('CURLINFO_OS_ERRNO', 2097177);
-// define('CURLINFO_NUM_CONNECTS', 100030);
+define('CURLINFO_NUM_CONNECTS', 2097178);
// define('CURLINFO_FTP_ENTRY_PATH', 100031);
define('CURLINFO_APPCONNECT_TIME', 3145761);
define('CURLINFO_CONDITION_UNMET', 2097187);
diff --git a/runtime-light/stdlib/curl/curl-easy-functions.h b/runtime-light/stdlib/curl/curl-easy-functions.h
index 33c5211ef3..bacead45d4 100644
--- a/runtime-light/stdlib/curl/curl-easy-functions.h
+++ b/runtime-light/stdlib/curl/curl-easy-functions.h
@@ -383,7 +383,7 @@ inline auto f$curl_setopt(kphp::web::curl::easy_type easy_id, int64_t option, co
return true;
}
case kphp::web::curl::CURLOPT::USERPWD: {
- kphp::log::error("Unsupported CURL options");
+ kphp::log::error("Unsupported CURL option");
}
default:
easy_ctx.set_errno(kphp::web::curl::CURLE::UNKNOWN_OPTION);
@@ -580,6 +580,9 @@ inline auto f$curl_getinfo(kphp::web::curl::easy_type easy_id, int64_t option =
kphp::log::assertion(v != (*res).end());
co_return v->second.to_mixed();
}
+ case kphp::web::curl::CURLINFO::NUM_CONNECTS: {
+ kphp::log::error("Unsupported CURL info option");
+ }
default:
co_return false;
}
diff --git a/runtime-light/stdlib/curl/defs.h b/runtime-light/stdlib/curl/defs.h
index 451bc86026..4efa725d9b 100644
--- a/runtime-light/stdlib/curl/defs.h
+++ b/runtime-light/stdlib/curl/defs.h
@@ -51,6 +51,7 @@ enum class CURLINFO : uint64_t {
LOCAL_PORT = 2097194,
HTTP_CONNECTCODE = 2097174,
OS_ERRNO = 2097177,
+ NUM_CONNECTS = 2097178,
APPCONNECT_TIME = 3145761,
CONDITION_UNMET = 2097187,
HEADER_OUT = 2,