From 87bc0f64e575a88a5ad980d9c88ad933a4c66a02 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 7 Feb 2020 10:26:44 +0100 Subject: anzeige.c: query dns more often to make entries in bind quasi-permanent (?) --- anzeige.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/anzeige.c b/anzeige.c index 7e89295..a1ad81f 100644 --- a/anzeige.c +++ b/anzeige.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "fonts.h" #include "input_gadgets.h" @@ -20,6 +21,7 @@ void handle_signals(int signo); t_scroll_data scroll_data; time_t next_update = 0; +time_t next_dns_query = 0; int main(int argc, char **argv) { @@ -80,6 +82,7 @@ int main(int argc, char **argv) } if ((time(NULL) >= next_update) && (scroll_data . update == 0)) { next_update = time(NULL) + 600; // 10 minutes ahead + next_dns_query = time(NULL) + 30; // 1/2 minute ahead memset(text_buffer, 0, TEXT_BUFFER_LENGTH); @@ -148,6 +151,13 @@ int main(int argc, char **argv) ); scroll_data . update = 1; } + if (time(NULL) >= next_dns_query) { + next_dns_query = time(NULL) + 30; // 1/2 minute ahead + gethostbyname("wetter.mb.fh-jena.de"); + gethostbyname("api.met.no"); + gethostbyname("opendata.dwd.de"); + gethostbyname("kpi.ddns.eckner.net"); + } usleep(100000); } -- cgit v1.2.3-54-g00ecf