From 6daa62b0b3c4cee8a2a9916c34dc92326ee42793 Mon Sep 17 00:00:00 2001 From: Michael Uleysky Date: Sat, 7 Dec 2024 15:43:53 +1000 Subject: [PATCH] Using proxy for data and metadata then mirroring Copernicus files --- sources/COPERNICUS.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sources/COPERNICUS.cpp b/sources/COPERNICUS.cpp index 48747a7..cd64200 100644 --- a/sources/COPERNICUS.cpp +++ b/sources/COPERNICUS.cpp @@ -37,6 +37,13 @@ RetVal> COPERNICUSData::ReadRemoteFileList(const MS bool next = true; CURLRAII chandle; + { + auto oldprefix = michlib::GPL.UsePrefix("COPERNICUS"); + auto proxyurl = michlib::GPL.ParameterSValue("Proxy", ""); + if(proxyurl.Exist()) curl_easy_setopt(chandle, CURLOPT_PROXY, proxyurl.Buf()); + michlib::GPL.UsePrefix(oldprefix); + } + while(next) { MString url = bucket + "?list-type=2&prefix=" + prefix; @@ -133,6 +140,11 @@ Error COPERNICUSData::Mirror(const CLArgs& args) const if(filter.Compile() != 0) return Error(pref, MString("Can't compile regular expression ") + filter.RegStr()); CURLRAII chandle; + { + auto proxyurl = michlib::GPL.ParameterSValue("Proxy", ""); + if(proxyurl.Exist()) curl_easy_setopt(chandle, CURLOPT_PROXY, proxyurl.Buf()); + } + for(const auto& dset: dsets) { michlib::message("Mirroring " + dset);