Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: hardcoded download test file DO NOT MERGE #2462

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/mavsdk/core/curl_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ bool CurlWrapper::download_text(const std::string& url, std::string& content)
curl_easy_setopt(curl.get(), CURLOPT_URL, url.c_str());
curl_easy_setopt(curl.get(), CURLOPT_WRITEFUNCTION, write_callback);
curl_easy_setopt(curl.get(), CURLOPT_WRITEDATA, &readBuffer);
curl_easy_setopt(curl.get(), CURLOPT_SSL_VERIFYPEER, 1L);
curl_easy_setopt(curl.get(), CURLOPT_FOLLOWLOCATION, 1L);
res = curl_easy_perform(curl.get());
content = readBuffer;

Expand Down Expand Up @@ -108,6 +110,8 @@ bool CurlWrapper::download_file_to_path(
curl_easy_setopt(curl.get(), CURLOPT_WRITEFUNCTION, NULL);
curl_easy_setopt(curl.get(), CURLOPT_WRITEDATA, fp);
curl_easy_setopt(curl.get(), CURLOPT_NOPROGRESS, 0L);
curl_easy_setopt(curl.get(), CURLOPT_SSL_VERIFYPEER, 1L);
curl_easy_setopt(curl.get(), CURLOPT_FOLLOWLOCATION, 1L);
res = curl_easy_perform(curl.get());
fclose(fp);

Expand Down
7 changes: 5 additions & 2 deletions third_party/curl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@ list(APPEND CMAKE_ARGS
"-DCURL_USE_LIBSSH2=OFF"
"-DBUILD_CURL_EXE=OFF"
"-DBUILD_SHARED_LIBS=OFF"
"-DCURL_CA_PATH_SET=OFF"
"-DCURL_ZLIB=OFF"
"-DHTTP_ONLY=ON"
"-DHAVE_POSIX_STRERROR_R=1"
"-DBUILD_TESTING=OFF"
)

if(IOS)
if(ANDROID)
list(APPEND CMAKE_ARGS
"-DCURL_CA_PATH=/system/etc/security/cacerts"
)
elseif(IOS)
list(APPEND CMAKE_ARGS
"-DPLATFORM=${PLATFORM}"
"-DDEPLOYMENT_TARGET=${DEPLOYMENT_TARGET}"
Expand Down
Loading