From e4f85f420b5006f1e7ca49f00783f96d83067242 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 16 Feb 2010 08:49:36 +0000 Subject: [PATCH] revalidate before expiration --- src/transport/gnunet-service-transport.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index b7848be40..f375887ed 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c @@ -91,9 +91,9 @@ #define TRANSPORT_DEFAULT_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15) /** - * FIXME: document! + * Priority to use for PONG messages. */ -#define TRANSPORT_DEFAULT_PRIORITY 4 +#define TRANSPORT_PONG_PRIORITY 4 /** * How often do we re-add (cheaper) plugins to our list of plugins @@ -109,6 +109,14 @@ #define HELLO_ADDRESS_EXPIRATION GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 12) +/** + * How long before an existing address expires should we again try to + * validate it? Must be (significantly) smaller than + * HELLO_ADDRESS_EXPIRATION. + */ +#define HELLO_REVALIDATION_START_TIME GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_HOURS, 1) + + /** * List of addresses of other peers */ @@ -2174,7 +2182,7 @@ check_hello_validated (void *cls, n); GNUNET_HELLO_iterate_new_addresses (chvc->hello, h, - GNUNET_TIME_absolute_get (), + GNUNET_TIME_relative_to_absolute (HELLO_REVALIDATION_START_TIME), &run_validation, chvc); } @@ -2425,7 +2433,7 @@ handle_ping(void *cls, const struct GNUNET_MessageHeader *message, while (fal != NULL) { transmit_to_peer(NULL, fal, - TRANSPORT_DEFAULT_PRIORITY, + TRANSPORT_PONG_PRIORITY, (const char *)pong, ntohs(pong->header.size), GNUNET_YES, -- 2.25.1