From 6c568a521fbaa1b35b3f4f4711f23d828543d02f Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Thu, 11 Oct 2018 08:43:56 +0200 Subject: Refactor urls in ClockTAI --- src/ClockTAI.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src') 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 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 -- cgit v1.2.3