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/transport/gnunet-service-transport.c | |
parent | 33bc21c1a116c35b0bea87b09b18ce2683c7e16b (diff) | |
download | gnunet-ff6b5bb3cfeeaaf353bf734c09619c4adbd02ee6.tar.gz gnunet-ff6b5bb3cfeeaaf353bf734c09619c4adbd02ee6.zip |
configurable hello expiration
Diffstat (limited to 'src/transport/gnunet-service-transport.c')
-rw-r--r-- | src/transport/gnunet-service-transport.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index da6812c96..0b596d021 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c | |||
@@ -91,6 +91,11 @@ struct GNUNET_ATS_SchedulingHandle *GST_ats; | |||
91 | */ | 91 | */ |
92 | static int connections; | 92 | static int connections; |
93 | 93 | ||
94 | /** | ||
95 | * Hello address expiration | ||
96 | */ | ||
97 | struct GNUNET_TIME_Relative hello_expiration; | ||
98 | |||
94 | 99 | ||
95 | /** | 100 | /** |
96 | * Transmit our HELLO message to the given (connected) neighbour. | 101 | * Transmit our HELLO message to the given (connected) neighbour. |
@@ -114,7 +119,7 @@ transmit_our_hello (void *cls, const struct GNUNET_PeerIdentity *target, | |||
114 | const struct GNUNET_MessageHeader *hello = cls; | 119 | const struct GNUNET_MessageHeader *hello = cls; |
115 | 120 | ||
116 | GST_neighbours_send (target, (const char *) hello, ntohs (hello->size), | 121 | GST_neighbours_send (target, (const char *) hello, ntohs (hello->size), |
117 | GNUNET_CONSTANTS_HELLO_ADDRESS_EXPIRATION, NULL, NULL); | 122 | hello_expiration, NULL, NULL); |
118 | } | 123 | } |
119 | 124 | ||
120 | 125 | ||
@@ -675,6 +680,12 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
675 | GNUNET_SCHEDULER_shutdown (); | 680 | GNUNET_SCHEDULER_shutdown (); |
676 | return; | 681 | return; |
677 | } | 682 | } |
683 | if (GNUNET_OK != | ||
684 | GNUNET_CONFIGURATION_get_value_time (c, "transport", "HELLO_EXPIRATION", | ||
685 | &hello_expiration)) | ||
686 | { | ||
687 | hello_expiration = GNUNET_CONSTANTS_HELLO_ADDRESS_EXPIRATION; | ||
688 | } | ||
678 | GST_server = server; | 689 | GST_server = server; |
679 | GNUNET_SERVER_suspend (server); | 690 | GNUNET_SERVER_suspend (server); |
680 | GST_keygen = GNUNET_CRYPTO_rsa_key_create_start (keyfile, &key_generation_cb, NULL); | 691 | GST_keygen = GNUNET_CRYPTO_rsa_key_create_start (keyfile, &key_generation_cb, NULL); |