aboutsummaryrefslogtreecommitdiff
path: root/src/vpn/gnunet-daemon-vpn.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-06-15 07:56:14 +0000
committerChristian Grothoff <christian@grothoff.org>2011-06-15 07:56:14 +0000
commitc0509e6458b802101cbf22e242805c6fda410418 (patch)
tree6399279706bdaa4d26c91dd969b730df21c9c4c5 /src/vpn/gnunet-daemon-vpn.c
parent3e6c37c25b646fbe5dda5ec48959281c88edbaba (diff)
downloadgnunet-c0509e6458b802101cbf22e242805c6fda410418.tar.gz
gnunet-c0509e6458b802101cbf22e242805c6fda410418.zip
cleanup
Diffstat (limited to 'src/vpn/gnunet-daemon-vpn.c')
-rw-r--r--src/vpn/gnunet-daemon-vpn.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/vpn/gnunet-daemon-vpn.c b/src/vpn/gnunet-daemon-vpn.c
index 9a1f69c72..cef876b52 100644
--- a/src/vpn/gnunet-daemon-vpn.c
+++ b/src/vpn/gnunet-daemon-vpn.c
@@ -61,6 +61,10 @@ static int ret;
61 */ 61 */
62static struct GNUNET_CONTAINER_MultiHashMap *udp_connections; 62static struct GNUNET_CONTAINER_MultiHashMap *udp_connections;
63 63
64GNUNET_SCHEDULER_TaskIdentifier conn_task;
65
66GNUNET_SCHEDULER_TaskIdentifier shs_task;
67
64/** 68/**
65 * Function scheduled as very last function, cleans up after us 69 * Function scheduled as very last function, cleans up after us
66 *{{{ 70 *{{{
@@ -84,6 +88,16 @@ cleanup(void* cls __attribute__((unused)), const struct GNUNET_SCHEDULER_TaskCon
84 GNUNET_MESH_disconnect(mesh_handle); 88 GNUNET_MESH_disconnect(mesh_handle);
85 mesh_handle = NULL; 89 mesh_handle = NULL;
86 } 90 }
91 if (GNUNET_SCHEDULER_NO_TASK != shs_task)
92 {
93 GNUNET_SCHEDULER_cancel (shs_task);
94 shs_task = GNUNET_SCHEDULER_NO_TASK;
95 }
96 if (GNUNET_SCHEDULER_NO_TASK != conn_task)
97 {
98 GNUNET_SCHEDULER_cancel (conn_task);
99 conn_task = GNUNET_SCHEDULER_NO_TASK;
100 }
87} 101}
88/*}}}*/ 102/*}}}*/
89 103
@@ -733,8 +747,8 @@ run (void *cls,
733 GNUNET_CONFIGURATION_get_value_number (cfg, "vpn", "MAX_MAPPINGg", 747 GNUNET_CONFIGURATION_get_value_number (cfg, "vpn", "MAX_MAPPINGg",
734 &max_mappings); 748 &max_mappings);
735 udp_connections = GNUNET_CONTAINER_multihashmap_create(65536); 749 udp_connections = GNUNET_CONTAINER_multihashmap_create(65536);
736 GNUNET_SCHEDULER_TaskIdentifier conn_task = GNUNET_SCHEDULER_add_now (connect_to_service_dns, NULL); 750 conn_task = GNUNET_SCHEDULER_add_now (connect_to_service_dns, NULL);
737 GNUNET_SCHEDULER_add_after (conn_task, start_helper_and_schedule, NULL); 751 shs_task = GNUNET_SCHEDULER_add_after (conn_task, start_helper_and_schedule, NULL);
738 GNUNET_SCHEDULER_add_delayed(GNUNET_TIME_UNIT_FOREVER_REL, &cleanup, cls); 752 GNUNET_SCHEDULER_add_delayed(GNUNET_TIME_UNIT_FOREVER_REL, &cleanup, cls);
739} 753}
740 754