Skip to content

Commit b27c8f2

Browse files
authored
Mark CURLOPT_USERPWD as unsupported but available option (#1467)
Signed-off-by: Petr Shumilov <p.shumilov@vkteam.ru>
1 parent f24b2bb commit b27c8f2

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

builtin-functions/kphp-light/stdlib/curl-functions.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ define('CURLOPT_SSL_CIPHER_LIST', 10083);
148148
define('CURLOPT_URL', 10002);
149149
define('CURLOPT_USERAGENT', 10018);
150150
define('CURLOPT_USERNAME', 10173);
151-
// define('CURLOPT_USERPWD', 10005);
151+
define('CURLOPT_USERPWD', 10005);
152152
// define('CURLOPT_HTTP200ALIASES', 10104);
153153
define('CURLOPT_HTTPHEADER', 10023);
154154
// define('CURLOPT_POSTQUOTE', 10039);

runtime-light/stdlib/curl/curl-easy-functions.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ inline auto f$curl_setopt(kphp::web::curl::easy_type easy_id, int64_t option, co
182182
case kphp::web::curl::CURLOPT::URL:
183183
case kphp::web::curl::CURLOPT::USERAGENT:
184184
case kphp::web::curl::CURLOPT::USERNAME:
185-
// case kphp::web::curl::CURLOPT::USERPWD:
186185
case kphp::web::curl::CURLOPT::ACCEPT_ENCODING: {
187186
auto res{kphp::web::set_transfer_property(st, option, kphp::web::property_value::as_string(value.to_string()))};
188187
if (!res.has_value()) [[unlikely]] {
@@ -383,6 +382,9 @@ inline auto f$curl_setopt(kphp::web::curl::easy_type easy_id, int64_t option, co
383382
easy_ctx.set_errno(kphp::web::curl::CURLE::OK);
384383
return true;
385384
}
385+
case kphp::web::curl::CURLOPT::USERPWD: {
386+
kphp::log::error("Unsupported CURL options");
387+
}
386388
default:
387389
easy_ctx.set_errno(kphp::web::curl::CURLE::UNKNOWN_OPTION);
388390
return false;

runtime-light/stdlib/curl/defs.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ enum class CURLOPT : uint64_t {
173173
URL = 10002,
174174
USERAGENT = 10018,
175175
USERNAME = 10173,
176-
// USERPWD = 10005,
176+
USERPWD = 10005,
177177

178178
// HTTP200ALIASES = 10104,
179179
HTTPHEADER = 10023,

0 commit comments

Comments
 (0)