| 541 | }; |
| 542 | |
| 543 | char **CPLHTTPGetOptionsFromEnv(const char *pszFilename) |
| 544 | { |
| 545 | CPLStringList aosOptions; |
| 546 | std::string osNonStreamingFilename; |
| 547 | if (pszFilename && STARTS_WITH(pszFilename, "/vsi")) |
| 548 | { |
| 549 | VSIFilesystemHandler *poFSHandler = |
| 550 | VSIFileManager::GetHandler(pszFilename); |
| 551 | osNonStreamingFilename = |
| 552 | poFSHandler->GetNonStreamingFilename(pszFilename); |
| 553 | if (osNonStreamingFilename == pszFilename) |
| 554 | { |
| 555 | osNonStreamingFilename.clear(); |
| 556 | } |
| 557 | else |
| 558 | { |
| 559 | // CPLDebug("HTTP", "Non-streaming filename for %s: %s", pszFilename, osNonStreamingFilename.c_str()); |
| 560 | } |
| 561 | } |
| 562 | for (const auto &sTuple : asAssocEnvVarOptionName) |
| 563 | { |
| 564 | const char *pszVal = nullptr; |
| 565 | if (pszFilename) |
| 566 | { |
| 567 | pszVal = VSIGetPathSpecificOption(pszFilename, sTuple.pszEnvVar, |
| 568 | nullptr); |
| 569 | if (!pszVal && !osNonStreamingFilename.empty()) |
| 570 | { |
| 571 | pszVal = VSIGetPathSpecificOption( |
| 572 | osNonStreamingFilename.c_str(), sTuple.pszEnvVar, nullptr); |
| 573 | } |
| 574 | } |
| 575 | if (!pszVal) |
| 576 | { |
| 577 | pszVal = CPLGetConfigOption(sTuple.pszEnvVar, nullptr); |
| 578 | } |
| 579 | if (pszVal) |
| 580 | { |
| 581 | aosOptions.AddNameValue(sTuple.pszOptionName, pszVal); |
| 582 | } |
| 583 | } |
| 584 | return aosOptions.StealList(); |
| 585 | } |
| 586 | |
| 587 | /************************************************************************/ |
| 588 | /* CPLHTTPGetNewRetryDelay() */ |
no test coverage detected