mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-09 15:42:11 +08:00
Cabana: fix for internal source (#36998)
* fix for internal sources from cursor * clean up * more * not needed * clean up * sure
This commit is contained in:
@@ -17,7 +17,7 @@ std::string cacheFilePath(const std::string &url) {
|
||||
}
|
||||
|
||||
std::string FileReader::read(const std::string &file, std::atomic<bool> *abort) {
|
||||
const bool is_remote = file.find("https://") == 0;
|
||||
const bool is_remote = (file.find("https://") == 0) || (file.find("http://") == 0);
|
||||
const std::string local_file = is_remote ? cacheFilePath(file) : file;
|
||||
std::string result;
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ FrameReader::~FrameReader() {
|
||||
}
|
||||
|
||||
bool FrameReader::load(CameraType type, const std::string &url, bool no_hw_decoder, std::atomic<bool> *abort, bool local_cache, int chunk_size, int retries) {
|
||||
auto local_file_path = url.find("https://") == 0 ? cacheFilePath(url) : url;
|
||||
auto local_file_path = (url.find("https://") == 0 || url.find("http://") == 0) ? cacheFilePath(url) : url;
|
||||
if (!util::file_exists(local_file_path)) {
|
||||
FileReader f(local_cache, chunk_size, retries);
|
||||
if (f.read(url, abort).empty()) {
|
||||
|
||||
@@ -154,6 +154,8 @@ size_t getRemoteFileSize(const std::string &url, std::atomic<bool> *abort) {
|
||||
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, dumy_write_cb);
|
||||
curl_easy_setopt(curl, CURLOPT_HEADER, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_NOBODY, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1);
|
||||
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
|
||||
|
||||
CURLM *cm = curl_multi_init();
|
||||
curl_multi_add_handle(cm, curl);
|
||||
|
||||
Reference in New Issue
Block a user