diff options
author | Bart Polot <bart@net.in.tum.de> | 2014-04-10 00:01:17 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2014-04-10 00:01:17 +0000 |
commit | d3c25d11c49cc8a5cc21db70b19d9f2e04f57dc1 (patch) | |
tree | 67ecee557148fbbba0ef02ebf6d07ef8b80dd2ce /src/mesh | |
parent | 8bef6edb030e650160ec418f7a2ff4507865d77b (diff) | |
download | gnunet-d3c25d11c49cc8a5cc21db70b19d9f2e04f57dc1.tar.gz gnunet-d3c25d11c49cc8a5cc21db70b19d9f2e04f57dc1.zip |
- don't schedule tunnel destruction on shutdown
Diffstat (limited to 'src/mesh')
-rw-r--r-- | src/mesh/gnunet-service-mesh_tunnel.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/mesh/gnunet-service-mesh_tunnel.c b/src/mesh/gnunet-service-mesh_tunnel.c index 9e1975f76..30e960ead 100644 --- a/src/mesh/gnunet-service-mesh_tunnel.c +++ b/src/mesh/gnunet-service-mesh_tunnel.c | |||
@@ -2135,6 +2135,9 @@ delayed_destroy (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
2135 | void | 2135 | void |
2136 | GMT_destroy_empty (struct MeshTunnel3 *t) | 2136 | GMT_destroy_empty (struct MeshTunnel3 *t) |
2137 | { | 2137 | { |
2138 | if (GNUNET_YES == shutting_down) | ||
2139 | return; /* Will be destroyed immediately anyway */ | ||
2140 | |||
2138 | if (GNUNET_SCHEDULER_NO_TASK != t->destroy_task) | 2141 | if (GNUNET_SCHEDULER_NO_TASK != t->destroy_task) |
2139 | { | 2142 | { |
2140 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 2143 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
@@ -2197,12 +2200,6 @@ GMT_destroy (struct MeshTunnel3 *t) | |||
2197 | return; | 2200 | return; |
2198 | 2201 | ||
2199 | LOG (GNUNET_ERROR_TYPE_DEBUG, "destroying tunnel %s\n", GMP_2s (t->peer)); | 2202 | LOG (GNUNET_ERROR_TYPE_DEBUG, "destroying tunnel %s\n", GMP_2s (t->peer)); |
2200 | if (GNUNET_SCHEDULER_NO_TASK != t->destroy_task) | ||
2201 | { | ||
2202 | LOG (GNUNET_ERROR_TYPE_DEBUG, "cancelling %llX\n", t->destroy_task); | ||
2203 | GNUNET_SCHEDULER_cancel (t->destroy_task); | ||
2204 | t->destroy_task = GNUNET_SCHEDULER_NO_TASK; | ||
2205 | } | ||
2206 | 2203 | ||
2207 | GNUNET_break (GNUNET_YES == | 2204 | GNUNET_break (GNUNET_YES == |
2208 | GNUNET_CONTAINER_multipeermap_remove (tunnels, | 2205 | GNUNET_CONTAINER_multipeermap_remove (tunnels, |
@@ -2220,6 +2217,13 @@ GMT_destroy (struct MeshTunnel3 *t) | |||
2220 | /* Should only happen on shutdown, but it's ok. */ | 2217 | /* Should only happen on shutdown, but it's ok. */ |
2221 | } | 2218 | } |
2222 | 2219 | ||
2220 | if (GNUNET_SCHEDULER_NO_TASK != t->destroy_task) | ||
2221 | { | ||
2222 | LOG (GNUNET_ERROR_TYPE_DEBUG, "cancelling %llX\n", t->destroy_task); | ||
2223 | GNUNET_SCHEDULER_cancel (t->destroy_task); | ||
2224 | t->destroy_task = GNUNET_SCHEDULER_NO_TASK; | ||
2225 | } | ||
2226 | |||
2223 | GNUNET_STATISTICS_update (stats, "# tunnels", -1, GNUNET_NO); | 2227 | GNUNET_STATISTICS_update (stats, "# tunnels", -1, GNUNET_NO); |
2224 | GMP_set_tunnel (t->peer, NULL); | 2228 | GMP_set_tunnel (t->peer, NULL); |
2225 | 2229 | ||