gnunet

Main GNUnet Logic
Log | Files | Refs | Submodules | README | LICENSE

commit ba2eb52464565c879f08439ea8688fa388ea6847
parent a542abe16a1fe410eafb6ec273f8d7106709e28e
Author: Christian Grothoff <christian@grothoff.org>
Date:   Wed, 11 Jun 2014 10:07:44 +0000

-make retry nicer

Diffstat:
Msrc/util/gnunet-service-resolver.c | 11+++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/util/gnunet-service-resolver.c b/src/util/gnunet-service-resolver.c @@ -237,15 +237,18 @@ get_ip_as_string (struct GNUNET_SERVER_Client *client, } if (NULL != pos) { - if (1 == inet_pton (af, - pos->ip, - &ix)) + if ( (1 == inet_pton (af, + pos->ip, + &ix)) && + (GNUNET_TIME_absolute_get_duration (pos->last_request).rel_value_us > + 120 * 1000 * 1000LL) ) { + /* try again if still numeric AND 2 minutes have expired */ GNUNET_free_non_null (pos->addr); pos->addr = NULL; cache_resolve (pos); + pos->last_request = now; } - pos->last_request = now; } else {