diff options
author | Bart Polot <bart@net.in.tum.de> | 2011-09-09 17:48:28 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2011-09-09 17:48:28 +0000 |
commit | 7abcfdb4511a0b30583b4125ceff2d715f135464 (patch) | |
tree | dcf9fbdab18953c9256cb7eefb1c9d0d6bbd31a7 /src/mesh | |
parent | 27c5602e08caa837cf8bfcfe4bb9629f5d76231b (diff) | |
download | gnunet-7abcfdb4511a0b30583b4125ceff2d715f135464.tar.gz gnunet-7abcfdb4511a0b30583b4125ceff2d715f135464.zip |
Fixed broken assertions on abort
Diffstat (limited to 'src/mesh')
-rw-r--r-- | src/mesh/gnunet-service-mesh.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c index 063339489..f31ff63ba 100644 --- a/src/mesh/gnunet-service-mesh.c +++ b/src/mesh/gnunet-service-mesh.c | |||
@@ -1965,6 +1965,9 @@ dht_get_type_handler (void *cls, struct GNUNET_TIME_Absolute exp, | |||
1965 | GNUNET_break_op (0); | 1965 | GNUNET_break_op (0); |
1966 | return; | 1966 | return; |
1967 | } | 1967 | } |
1968 | GNUNET_assert (NULL != t->client); | ||
1969 | GNUNET_DHT_get_stop(t->client->dht_get_type); | ||
1970 | t->client->dht_get_type = NULL; | ||
1968 | peer_info = get_peer_info (pi); | 1971 | peer_info = get_peer_info (pi); |
1969 | GNUNET_CONTAINER_multihashmap_put (t->peers, &pi->hashPubKey, peer_info, | 1972 | GNUNET_CONTAINER_multihashmap_put (t->peers, &pi->hashPubKey, peer_info, |
1970 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); | 1973 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); |
@@ -2059,12 +2062,16 @@ handle_client_disconnect (void *cls, struct GNUNET_SERVER_Client *client) | |||
2059 | GNUNET_CONTAINER_multihashmap_iterate(c->apps, &deregister_app, NULL); | 2062 | GNUNET_CONTAINER_multihashmap_iterate(c->apps, &deregister_app, NULL); |
2060 | GNUNET_CONTAINER_multihashmap_destroy(c->apps); | 2063 | GNUNET_CONTAINER_multihashmap_destroy(c->apps); |
2061 | } | 2064 | } |
2062 | if (0 == GNUNET_CONTAINER_multihashmap_size(applications)) | 2065 | if (0 == GNUNET_CONTAINER_multihashmap_size(applications) && |
2066 | GNUNET_SCHEDULER_NO_TASK != announce_applications_task) | ||
2063 | { | 2067 | { |
2064 | GNUNET_SCHEDULER_cancel (announce_applications_task); | 2068 | GNUNET_SCHEDULER_cancel (announce_applications_task); |
2069 | announce_applications_task = GNUNET_SCHEDULER_NO_TASK; | ||
2065 | } | 2070 | } |
2066 | if (NULL != c->types) | 2071 | if (NULL != c->types) |
2067 | GNUNET_CONTAINER_multihashmap_destroy(c->types); | 2072 | GNUNET_CONTAINER_multihashmap_destroy(c->types); |
2073 | if (NULL != c->dht_get_type) | ||
2074 | GNUNET_DHT_get_stop(c->dht_get_type); | ||
2068 | GNUNET_CONTAINER_DLL_remove (clients, clients_tail, c); | 2075 | GNUNET_CONTAINER_DLL_remove (clients, clients_tail, c); |
2069 | next = c->next; | 2076 | next = c->next; |
2070 | GNUNET_free (c); | 2077 | GNUNET_free (c); |
@@ -2839,6 +2846,8 @@ core_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer) | |||
2839 | static void | 2846 | static void |
2840 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 2847 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
2841 | { | 2848 | { |
2849 | struct MeshClient *c; | ||
2850 | |||
2842 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: shutting down\n"); | 2851 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: shutting down\n"); |
2843 | if (core_handle != NULL) | 2852 | if (core_handle != NULL) |
2844 | { | 2853 | { |
@@ -2847,6 +2856,9 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
2847 | } | 2856 | } |
2848 | if (dht_handle != NULL) | 2857 | if (dht_handle != NULL) |
2849 | { | 2858 | { |
2859 | for (c = clients; NULL != c; c = c->next) | ||
2860 | if (NULL != c->dht_get_type) | ||
2861 | GNUNET_DHT_get_stop(c->dht_get_type); | ||
2850 | GNUNET_DHT_disconnect (dht_handle); | 2862 | GNUNET_DHT_disconnect (dht_handle); |
2851 | dht_handle = NULL; | 2863 | dht_handle = NULL; |
2852 | } | 2864 | } |
@@ -2855,10 +2867,10 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
2855 | GNUNET_SERVER_notification_context_destroy (nc); | 2867 | GNUNET_SERVER_notification_context_destroy (nc); |
2856 | nc = NULL; | 2868 | nc = NULL; |
2857 | } | 2869 | } |
2858 | if (0 != announce_id_task) | 2870 | if (GNUNET_SCHEDULER_NO_TASK != announce_id_task) |
2859 | { | 2871 | { |
2860 | GNUNET_SCHEDULER_cancel (announce_id_task); | 2872 | GNUNET_SCHEDULER_cancel (announce_id_task); |
2861 | announce_id_task = 0; | 2873 | announce_id_task = GNUNET_SCHEDULER_NO_TASK; |
2862 | } | 2874 | } |
2863 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: shut down\n"); | 2875 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "MESH: shut down\n"); |
2864 | } | 2876 | } |