summaryrefslogtreecommitdiff
path: root/anzeige.c
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-02-07 10:26:44 +0100
committerErich Eckner <git@eckner.net>2020-02-07 10:26:44 +0100
commit87bc0f64e575a88a5ad980d9c88ad933a4c66a02 (patch)
tree9503e15abcdada800da5571707e644fdf84eac35 /anzeige.c
parent6af672d8d338e290e65d557231362f34e0e4e8f5 (diff)
downloadanzeige-87bc0f64e575a88a5ad980d9c88ad933a4c66a02.tar.xz
anzeige.c: query dns more often to make entries in bind quasi-permanent (?)
Diffstat (limited to 'anzeige.c')
-rw-r--r--anzeige.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/anzeige.c b/anzeige.c
index 7e89295..a1ad81f 100644
--- a/anzeige.c
+++ b/anzeige.c
@@ -10,6 +10,7 @@
#include <pthread.h>
#include <signal.h>
#include <time.h>
+#include <netdb.h>
#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);
}