From 6d9e4487e159e2cfac3dc706962a8a7780bfa34c Mon Sep 17 00:00:00 2001 From: Eugene Erokhin Date: Fri, 11 Nov 2016 22:53:31 +0600 Subject: [PATCH] ftnnode.c fix "no calls to unlisted with defnode enabled". MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Починил незвонки на непрописанные ноды при включенном defnode. В *get_node_info_nolock() проверка на np->recheck < safe_time() не давала вызывать get_defnode_info(). Перенёс проверку внутрь get_defnode_info(), завернул в неё саму srv_getaddrinfo(). --- ftnnode.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ftnnode.c b/ftnnode.c index 2b8d2b89..6e1f946d 100644 --- a/ftnnode.c +++ b/ftnnode.c @@ -246,8 +246,11 @@ static FTN_NODE *get_defnode_info(FTN_ADDR *fa, FTN_NODE *on, BINKD_CONFIG *conf if (!strcmp(host, "-")) continue; - aiErr = srv_getaddrinfo(host, port ? port : NULL, &hints, &ai); - if (aiErr != 0) continue; + if (&on->recheck < safe_time()) + { + aiErr = srv_getaddrinfo(host, port ? port : NULL, &hints, &ai); + if (aiErr != 0) continue; + } freeaddrinfo(ai); sprintf (host+strlen(host), ":%s", port); i=0; @@ -300,7 +303,7 @@ static FTN_NODE *get_node_info_nolock (FTN_ADDR *fa, BINKD_CONFIG *config) /* not found or not in config file and recheck required ... */ if (( !np || - (np->listed != NL_NODE && np->recheck < safe_time())) + (np->listed != NL_NODE)) && config->havedefnode) /* ... try resolve from defnode */ np=get_defnode_info(fa, np, config);