diff options
Diffstat (limited to 'src/mesh/gnunet-service-mesh.c')
-rw-r--r-- | src/mesh/gnunet-service-mesh.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index d545d8dd3..f07465ae2 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c | |||
@@ -1297,6 +1297,27 @@ core_disconnect (void *cls, | |||
1297 | /******************************************************************************/ | 1297 | /******************************************************************************/ |
1298 | 1298 | ||
1299 | /** | 1299 | /** |
1300 | * Task run during shutdown. | ||
1301 | * | ||
1302 | * @param cls unused | ||
1303 | * @param tc unused | ||
1304 | */ | ||
1305 | static void | ||
1306 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | ||
1307 | { | ||
1308 | if (core_handle != NULL) | ||
1309 | { | ||
1310 | GNUNET_CORE_disconnect (core_handle); | ||
1311 | core_handle = NULL; | ||
1312 | } | ||
1313 | if (dht_handle != NULL) | ||
1314 | { | ||
1315 | GNUNET_DHT_disconnect (dht_handle); | ||
1316 | dht_handle = NULL; | ||
1317 | } | ||
1318 | } | ||
1319 | |||
1320 | /** | ||
1300 | * Process mesh requests. | 1321 | * Process mesh requests. |
1301 | * | 1322 | * |
1302 | * @param cls closure | 1323 | * @param cls closure |
@@ -1331,6 +1352,11 @@ GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "******* MESH DEBUG MESSAGE 4 ********\n"); | |||
1331 | if (dht_handle == NULL) { | 1352 | if (dht_handle == NULL) { |
1332 | GNUNET_break(0); | 1353 | GNUNET_break(0); |
1333 | } | 1354 | } |
1355 | |||
1356 | /* Scheduled the task to clean up when shutdown is called */ | ||
1357 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, | ||
1358 | &shutdown_task, NULL); | ||
1359 | |||
1334 | } | 1360 | } |
1335 | 1361 | ||
1336 | /** | 1362 | /** |