diff options
author | Christian Grothoff <christian@grothoff.org> | 2014-06-11 10:07:44 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2014-06-11 10:07:44 +0000 |
commit | ba2eb52464565c879f08439ea8688fa388ea6847 (patch) | |
tree | 5e190ec022a715c41800b7461171ad17acad1235 /src/util | |
parent | a542abe16a1fe410eafb6ec273f8d7106709e28e (diff) | |
download | gnunet-ba2eb52464565c879f08439ea8688fa388ea6847.tar.gz gnunet-ba2eb52464565c879f08439ea8688fa388ea6847.zip |
-make retry nicer
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/gnunet-service-resolver.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/util/gnunet-service-resolver.c b/src/util/gnunet-service-resolver.c index 96ed101f7..f3675edb3 100644 --- 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, | |||
237 | } | 237 | } |
238 | if (NULL != pos) | 238 | if (NULL != pos) |
239 | { | 239 | { |
240 | if (1 == inet_pton (af, | 240 | if ( (1 == inet_pton (af, |
241 | pos->ip, | 241 | pos->ip, |
242 | &ix)) | 242 | &ix)) && |
243 | (GNUNET_TIME_absolute_get_duration (pos->last_request).rel_value_us > | ||
244 | 120 * 1000 * 1000LL) ) | ||
243 | { | 245 | { |
246 | /* try again if still numeric AND 2 minutes have expired */ | ||
244 | GNUNET_free_non_null (pos->addr); | 247 | GNUNET_free_non_null (pos->addr); |
245 | pos->addr = NULL; | 248 | pos->addr = NULL; |
246 | cache_resolve (pos); | 249 | cache_resolve (pos); |
250 | pos->last_request = now; | ||
247 | } | 251 | } |
248 | pos->last_request = now; | ||
249 | } | 252 | } |
250 | else | 253 | else |
251 | { | 254 | { |