diff options
Diffstat (limited to 'src/transport/gnunet-service-tng.c')
-rw-r--r-- | src/transport/gnunet-service-tng.c | 65 |
1 files changed, 63 insertions, 2 deletions
diff --git a/src/transport/gnunet-service-tng.c b/src/transport/gnunet-service-tng.c index f57d08395..64cb53ad8 100644 --- a/src/transport/gnunet-service-tng.c +++ b/src/transport/gnunet-service-tng.c | |||
@@ -5164,9 +5164,10 @@ handle_del_address (void *cls, | |||
5164 | ale->address); | 5164 | ale->address); |
5165 | free_address_list_entry (ale); | 5165 | free_address_list_entry (ale); |
5166 | GNUNET_SERVICE_client_continue (tc->client); | 5166 | GNUNET_SERVICE_client_continue (tc->client); |
5167 | return; | ||
5167 | } | 5168 | } |
5168 | GNUNET_break (0); | 5169 | GNUNET_break (0); |
5169 | GNUNET_SERVICE_client_drop (tc->client); | 5170 | //GNUNET_SERVICE_client_drop (tc->client); |
5170 | } | 5171 | } |
5171 | 5172 | ||
5172 | 5173 | ||
@@ -10045,6 +10046,52 @@ free_ack_cummulator_cb (void *cls, | |||
10045 | return GNUNET_OK; | 10046 | return GNUNET_OK; |
10046 | } | 10047 | } |
10047 | 10048 | ||
10049 | void | ||
10050 | cleanup_client (struct TransportClient *tc) | ||
10051 | { | ||
10052 | switch (tc->type) | ||
10053 | { | ||
10054 | case CT_NONE: | ||
10055 | break; | ||
10056 | |||
10057 | case CT_CORE: { | ||
10058 | struct PendingMessage *pm; | ||
10059 | |||
10060 | while (NULL != (pm = tc->details.core.pending_msg_head)) | ||
10061 | { | ||
10062 | GNUNET_CONTAINER_MDLL_remove (client, | ||
10063 | tc->details.core.pending_msg_head, | ||
10064 | tc->details.core.pending_msg_tail, | ||
10065 | pm); | ||
10066 | pm->client = NULL; | ||
10067 | } | ||
10068 | } | ||
10069 | break; | ||
10070 | |||
10071 | case CT_MONITOR: | ||
10072 | break; | ||
10073 | |||
10074 | case CT_COMMUNICATOR: { | ||
10075 | struct Queue *q; | ||
10076 | struct AddressListEntry *ale; | ||
10077 | |||
10078 | while (NULL != (q = tc->details.communicator.queue_head)) | ||
10079 | free_queue (q); | ||
10080 | while (NULL != (ale = tc->details.communicator.addr_head)) | ||
10081 | free_address_list_entry (ale); | ||
10082 | GNUNET_free (tc->details.communicator.address_prefix); | ||
10083 | } | ||
10084 | break; | ||
10085 | |||
10086 | case CT_APPLICATION: | ||
10087 | GNUNET_CONTAINER_multipeermap_iterate (tc->details.application.requests, | ||
10088 | &stop_peer_request, | ||
10089 | tc); | ||
10090 | GNUNET_CONTAINER_multipeermap_destroy (tc->details.application.requests); | ||
10091 | break; | ||
10092 | } | ||
10093 | |||
10094 | } | ||
10048 | 10095 | ||
10049 | /** | 10096 | /** |
10050 | * Function called when the service shuts down. Unloads our plugins | 10097 | * Function called when the service shuts down. Unloads our plugins |
@@ -10056,9 +10103,13 @@ static void | |||
10056 | do_shutdown (void *cls) | 10103 | do_shutdown (void *cls) |
10057 | { | 10104 | { |
10058 | struct LearnLaunchEntry *lle; | 10105 | struct LearnLaunchEntry *lle; |
10106 | struct TransportClient *client; | ||
10059 | 10107 | ||
10060 | (void) cls; | 10108 | (void) cls; |
10061 | 10109 | for (client = clients_head; NULL != client; client = client->next) | |
10110 | { | ||
10111 | cleanup_client (client); | ||
10112 | } | ||
10062 | //GNUNET_CONTAINER_multipeermap_iterate (neighbours, | 10113 | //GNUNET_CONTAINER_multipeermap_iterate (neighbours, |
10063 | //&free_neighbour_cb, NULL); | 10114 | //&free_neighbour_cb, NULL); |
10064 | if (NULL != peerstore) | 10115 | if (NULL != peerstore) |
@@ -10066,6 +10117,16 @@ do_shutdown (void *cls) | |||
10066 | GNUNET_PEERSTORE_disconnect (peerstore, GNUNET_NO); | 10117 | GNUNET_PEERSTORE_disconnect (peerstore, GNUNET_NO); |
10067 | peerstore = NULL; | 10118 | peerstore = NULL; |
10068 | } | 10119 | } |
10120 | if (NULL != validation_task) | ||
10121 | { | ||
10122 | GNUNET_SCHEDULER_cancel (validation_task); | ||
10123 | validation_task = NULL; | ||
10124 | } | ||
10125 | if (NULL != dvlearn_task) | ||
10126 | { | ||
10127 | GNUNET_SCHEDULER_cancel (dvlearn_task); | ||
10128 | dvlearn_task = NULL; | ||
10129 | } | ||
10069 | if (NULL != GST_stats) | 10130 | if (NULL != GST_stats) |
10070 | { | 10131 | { |
10071 | GNUNET_STATISTICS_destroy (GST_stats, GNUNET_NO); | 10132 | GNUNET_STATISTICS_destroy (GST_stats, GNUNET_NO); |