aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2018-10-11 08:43:56 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2018-10-11 08:43:56 +0200
commit6c568a521fbaa1b35b3f4f4711f23d828543d02f (patch)
treecfc60443904f97c300f7c677e1ca4bd9638377af
parent965b6635158c4d46e0d658a42a405f97078fe275 (diff)
downloaddabmux-6c568a521fbaa1b35b3f4f4711f23d828543d02f.tar.gz
dabmux-6c568a521fbaa1b35b3f4f4711f23d828543d02f.tar.bz2
dabmux-6c568a521fbaa1b35b3f4f4711f23d828543d02f.zip
Refactor urls in ClockTAI
-rw-r--r--src/ClockTAI.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/ClockTAI.cpp b/src/ClockTAI.cpp
index c481841..b14de8d 100644
--- a/src/ClockTAI.cpp
+++ b/src/ClockTAI.cpp
@@ -67,12 +67,11 @@ constexpr int download_retry_interval_hours = 1;
// timestamp_unix = timestamp_ntp - ntp_unix_offset
const int64_t ntp_unix_offset = 2208988800L;
-// leap seconds insertion bulletin is available at
-static const char* tai_ietf_url =
- "http://www.ietf.org/timezones/data/leap-seconds.list";
-// and in the tz distribution
-static const char* tai_tz_url =
- "https://raw.githubusercontent.com/eggert/tz/master/leap-seconds.list";
+// leap seconds insertion bulletin is available from the IETF and in the TZ
+// distribution
+static array<const char*, 2> tai_urls = {
+ "http://www.ietf.org/timezones/data/leap-seconds.list",
+ "https://raw.githubusercontent.com/eggert/tz/master/leap-seconds.list"};
static const char* tai_ietf_cache_file = "/tmp/odr-dabmux-leap-seconds.cache";
@@ -105,7 +104,7 @@ int ClockTAI::get_valid_offset()
offset_valid = true;
}
else {
- for (const auto url : {tai_ietf_url, tai_tz_url}) {
+ for (const auto url : tai_urls) {
try {
download_tai_utc_bulletin(url);
#if TEST