diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-09-02 11:21:00 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-09-02 11:21:00 +0000 |
commit | 147d72a99e4ed0558c98fe7c9c41062ede51a68a (patch) | |
tree | f712c8aa222e53dc3e299972f3144ad92b15b180 /src/dht | |
parent | 8439fe12f24ab3ae5a1821face2b79d443fa044e (diff) | |
download | gnunet-147d72a99e4ed0558c98fe7c9c41062ede51a68a.tar.gz gnunet-147d72a99e4ed0558c98fe7c9c41062ede51a68a.zip |
cleanup API for get_hello and get_hello_cancel
Diffstat (limited to 'src/dht')
-rw-r--r-- | src/dht/gnunet-service-dht.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c index cbeecb5cc..b864e39e3 100644 --- a/src/dht/gnunet-service-dht.c +++ b/src/dht/gnunet-service-dht.c | |||
@@ -782,6 +782,10 @@ static struct GNUNET_DATACACHE_Handle *datacache; | |||
782 | */ | 782 | */ |
783 | struct GNUNET_STATISTICS_Handle *stats; | 783 | struct GNUNET_STATISTICS_Handle *stats; |
784 | 784 | ||
785 | /** | ||
786 | * Handle to get our current HELLO. | ||
787 | */ | ||
788 | static struct GNUNET_TRANSPORT_GetHelloHandle *ghh; | ||
785 | 789 | ||
786 | /** | 790 | /** |
787 | * The configuration the DHT service is running with | 791 | * The configuration the DHT service is running with |
@@ -5001,11 +5005,16 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
5001 | int bucket_count; | 5005 | int bucket_count; |
5002 | struct PeerInfo *pos; | 5006 | struct PeerInfo *pos; |
5003 | 5007 | ||
5008 | if (NULL != ghh) | ||
5009 | { | ||
5010 | GNUNET_TRANSPORT_get_hello_cancel (ghh); | ||
5011 | ghh = NULL; | ||
5012 | } | ||
5004 | if (transport_handle != NULL) | 5013 | if (transport_handle != NULL) |
5005 | { | 5014 | { |
5006 | GNUNET_free_non_null (my_hello); | 5015 | GNUNET_free_non_null (my_hello); |
5007 | GNUNET_TRANSPORT_get_hello_cancel (transport_handle, &process_hello, NULL); | ||
5008 | GNUNET_TRANSPORT_disconnect (transport_handle); | 5016 | GNUNET_TRANSPORT_disconnect (transport_handle); |
5017 | transport_handle = NULL; | ||
5009 | } | 5018 | } |
5010 | if (coreAPI != NULL) | 5019 | if (coreAPI != NULL) |
5011 | { | 5020 | { |
@@ -5304,7 +5313,7 @@ run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
5304 | transport_handle = | 5313 | transport_handle = |
5305 | GNUNET_TRANSPORT_connect (cfg, NULL, NULL, NULL, NULL, NULL); | 5314 | GNUNET_TRANSPORT_connect (cfg, NULL, NULL, NULL, NULL, NULL); |
5306 | if (transport_handle != NULL) | 5315 | if (transport_handle != NULL) |
5307 | GNUNET_TRANSPORT_get_hello (transport_handle, &process_hello, NULL); | 5316 | ghh = GNUNET_TRANSPORT_get_hello (transport_handle, &process_hello, NULL); |
5308 | else | 5317 | else |
5309 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 5318 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
5310 | "Failed to connect to transport service!\n"); | 5319 | "Failed to connect to transport service!\n"); |