MCPcopy Create free account
hub / github.com/Kitware/CMake / HandleUploadCommand

Function HandleUploadCommand

Source/cmFileCommand.cxx:2391–2762  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2389}
2390
2391bool HandleUploadCommand(std::vector<std::string> const& args,
2392 cmExecutionStatus& status)
2393{
2394#if !defined(CMAKE_BOOTSTRAP)
2395 if (args.size() < 3) {
2396 status.SetError("UPLOAD must be called with at least three arguments.");
2397 return false;
2398 }
2399 auto i = args.begin();
2400 ++i;
2401 std::string filename = *i;
2402 ++i;
2403 std::string url = *i;
2404 ++i;
2405
2406 long timeout = 0;
2407 long inactivity_timeout = 0;
2408 std::string logVar;
2409 std::string statusVar;
2410 bool showProgress = false;
2411 cm::optional<std::string> tlsVersionOpt;
2412 cm::optional<bool> tlsVerifyOpt;
2413 cmValue cainfo = status.GetMakefile().GetDefinition("CMAKE_TLS_CAINFO");
2414 std::string userpwd;
2415 std::string netrc_level =
2416 status.GetMakefile().GetSafeDefinition("CMAKE_NETRC");
2417 std::string netrc_file =
2418 status.GetMakefile().GetSafeDefinition("CMAKE_NETRC_FILE");
2419
2420 std::vector<std::string> curl_headers;
2421
2422 while (i != args.end()) {
2423 if (*i == "TIMEOUT") {
2424 ++i;
2425 if (i != args.end()) {
2426 timeout = atol(i->c_str());
2427 } else {
2428 status.SetError("UPLOAD missing time for TIMEOUT.");
2429 return false;
2430 }
2431 } else if (*i == "INACTIVITY_TIMEOUT") {
2432 ++i;
2433 if (i != args.end()) {
2434 inactivity_timeout = atol(i->c_str());
2435 } else {
2436 status.SetError("UPLOAD missing time for INACTIVITY_TIMEOUT.");
2437 return false;
2438 }
2439 } else if (*i == "LOG") {
2440 ++i;
2441 if (i == args.end()) {
2442 status.SetError("UPLOAD missing VAR for LOG.");
2443 return false;
2444 }
2445 logVar = *i;
2446 } else if (*i == "STATUS") {
2447 ++i;
2448 if (i == args.end()) {

Callers

nothing calls this directly

Calls 15

cmIsOnFunction · 0.85
moveFunction · 0.85
CurlCompatFileURLFunction · 0.85
cm_curl_global_initFunction · 0.85
cm_curl_easy_initFunction · 0.85
curl_easy_setoptFunction · 0.85
cmCurlParseTLSVersionFunction · 0.85
cmCurlSetCAInfoFunction · 0.85
cmCurlSetNETRCOptionFunction · 0.85
curl_slist_appendFunction · 0.85
curl_easy_performFunction · 0.85
curl_slist_free_allFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…