Skip to content

Commit

Permalink
Fix #88: initial delay for unresolvable remote target
Browse files Browse the repository at this point in the history
Signed-off-by: Joachim Wiberg <[email protected]>
  • Loading branch information
troglobit committed Aug 26, 2024
1 parent 3a65bd2 commit 0e1e158
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/syslogd.c
Original file line number Diff line number Diff line change
Expand Up @@ -871,8 +871,14 @@ static int nslookup(const char *host, const char *service, struct addrinfo **ai)
if (!node || !node[0])
node = NULL;

/* Reset resolver cache and retry name lookup */
/*
* Reset resolver cache and retry name lookup. The use of
* `_res` here seems to be the most portable way to adjust
* the per-process timeout and retry.
*/
res_init();
_res.retrans = 1;
_res.retry = 1;

logit("nslookup '%s:%s'\n", node ?: "*", service);
memset(&hints, 0, sizeof(hints));
Expand Down

0 comments on commit 0e1e158

Please sign in to comment.