Browse Source

Added supporting proxy for access to the COPERNICUS catalog

master
Michael Uleysky 3 months ago
parent
commit
4294be57d1
  1. 8
      src/copcat.cpp

8
src/copcat.cpp

@ -7,16 +7,20 @@ const MString CopernicusCatalog::caturl = "https://stac.marine.copernicus.eu/met
CopernicusCatalog::CopernicusCatalog() CopernicusCatalog::CopernicusCatalog()
{ {
// Cache
auto oldprefix = michlib::GPL.UsePrefix("COPERNICUS"); auto oldprefix = michlib::GPL.UsePrefix("COPERNICUS");
// Cache
cache.reset(CreateCache(michlib::GPL.ParameterSValue("Cache", ""))); cache.reset(CreateCache(michlib::GPL.ParameterSValue("Cache", "")));
michlib::GPL.UsePrefix(oldprefix);
if(!cache) if(!cache)
{ {
michlib::errmessage("Can't init cache"); michlib::errmessage("Can't init cache");
cache.reset(new FakeCache); cache.reset(new FakeCache);
} }
// Proxy
auto proxyurl = michlib::GPL.ParameterSValue("Proxy", "");
if(proxyurl.Exist()) curl_easy_setopt(chandle, CURLOPT_PROXY, proxyurl.Buf());
michlib::GPL.UsePrefix(oldprefix);
GetCatalog(); GetCatalog();
} }

Loading…
Cancel
Save