diff options
author | Gabor X Toth <*@tg-x.net> | 2012-11-18 18:09:32 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2012-11-18 18:09:32 +0000 |
commit | ff6b5bb3cfeeaaf353bf734c09619c4adbd02ee6 (patch) | |
tree | e5e96be6a02776d9dc5de475c8bca7d471a696b5 /src/dht | |
parent | 33bc21c1a116c35b0bea87b09b18ce2683c7e16b (diff) | |
download | gnunet-ff6b5bb3cfeeaaf353bf734c09619c4adbd02ee6.tar.gz gnunet-ff6b5bb3cfeeaaf353bf734c09619c4adbd02ee6.zip |
configurable hello expiration
Diffstat (limited to 'src/dht')
-rw-r--r-- | src/dht/gnunet-service-dht.c | 11 | ||||
-rw-r--r-- | src/dht/gnunet-service-dht_neighbours.c | 8 |
2 files changed, 17 insertions, 2 deletions
diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c index 72575acae..5efa9ddc6 100644 --- a/src/dht/gnunet-service-dht.c +++ b/src/dht/gnunet-service-dht.c | |||
@@ -66,12 +66,16 @@ struct GNUNET_MessageHeader *GDS_my_hello; | |||
66 | */ | 66 | */ |
67 | struct GNUNET_TRANSPORT_Handle *GDS_transport_handle; | 67 | struct GNUNET_TRANSPORT_Handle *GDS_transport_handle; |
68 | 68 | ||
69 | |||
70 | /** | 69 | /** |
71 | * Handle to get our current HELLO. | 70 | * Handle to get our current HELLO. |
72 | */ | 71 | */ |
73 | static struct GNUNET_TRANSPORT_GetHelloHandle *ghh; | 72 | static struct GNUNET_TRANSPORT_GetHelloHandle *ghh; |
74 | 73 | ||
74 | /** | ||
75 | * Hello address expiration | ||
76 | */ | ||
77 | struct GNUNET_TIME_Relative hello_expiration; | ||
78 | |||
75 | 79 | ||
76 | /** | 80 | /** |
77 | * Receive the HELLO from transport service, free current and replace | 81 | * Receive the HELLO from transport service, free current and replace |
@@ -141,6 +145,11 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
141 | const struct GNUNET_CONFIGURATION_Handle *c) | 145 | const struct GNUNET_CONFIGURATION_Handle *c) |
142 | { | 146 | { |
143 | GDS_cfg = c; | 147 | GDS_cfg = c; |
148 | if (GNUNET_OK != | ||
149 | GNUNET_CONFIGURATION_get_value_time (c, "transport", "HELLO_EXPIRATION", &hello_expiration)) | ||
150 | { | ||
151 | hello_expiration = GNUNET_CONSTANTS_HELLO_ADDRESS_EXPIRATION; | ||
152 | } | ||
144 | GDS_block_context = GNUNET_BLOCK_context_create (GDS_cfg); | 153 | GDS_block_context = GNUNET_BLOCK_context_create (GDS_cfg); |
145 | GDS_stats = GNUNET_STATISTICS_create ("dht", GDS_cfg); | 154 | GDS_stats = GNUNET_STATISTICS_create ("dht", GDS_cfg); |
146 | GDS_ROUTING_init (); | 155 | GDS_ROUTING_init (); |
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c index 40b1013f3..4872b58a5 100644 --- a/src/dht/gnunet-service-dht_neighbours.c +++ b/src/dht/gnunet-service-dht_neighbours.c | |||
@@ -100,6 +100,12 @@ | |||
100 | #define LOG_ROUTE_DETAILS_STDERR GNUNET_NO | 100 | #define LOG_ROUTE_DETAILS_STDERR GNUNET_NO |
101 | 101 | ||
102 | 102 | ||
103 | /** | ||
104 | * Hello address expiration | ||
105 | */ | ||
106 | extern struct GNUNET_TIME_Relative hello_expiration; | ||
107 | |||
108 | |||
103 | GNUNET_NETWORK_STRUCT_BEGIN | 109 | GNUNET_NETWORK_STRUCT_BEGIN |
104 | 110 | ||
105 | /** | 111 | /** |
@@ -1683,7 +1689,7 @@ handle_find_peer (const struct GNUNET_PeerIdentity *sender, | |||
1683 | { | 1689 | { |
1684 | GDS_NEIGHBOURS_handle_reply (sender, GNUNET_BLOCK_TYPE_DHT_HELLO, | 1690 | GDS_NEIGHBOURS_handle_reply (sender, GNUNET_BLOCK_TYPE_DHT_HELLO, |
1685 | GNUNET_TIME_relative_to_absolute | 1691 | GNUNET_TIME_relative_to_absolute |
1686 | (GNUNET_CONSTANTS_HELLO_ADDRESS_EXPIRATION), | 1692 | (hello_expiration), |
1687 | key, 0, NULL, 0, NULL, GDS_my_hello, | 1693 | key, 0, NULL, 0, NULL, GDS_my_hello, |
1688 | GNUNET_HELLO_size ((const struct | 1694 | GNUNET_HELLO_size ((const struct |
1689 | GNUNET_HELLO_Message *) | 1695 | GNUNET_HELLO_Message *) |