diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-10-01 07:16:13 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-10-01 07:16:13 +0000 |
commit | 42cbac4233ac4f4b704649d069fe96d758610b28 (patch) | |
tree | 50ae08872c00af049e18d88ea33428e646b3c72a /src/dv/plugin_transport_dv.c | |
parent | 73b0aa3d9b66f2a9f08f9a75b36a4d993ca8a2c8 (diff) | |
download | gnunet-42cbac4233ac4f4b704649d069fe96d758610b28.tar.gz gnunet-42cbac4233ac4f4b704649d069fe96d758610b28.zip |
-fix ftbfs
Diffstat (limited to 'src/dv/plugin_transport_dv.c')
-rw-r--r-- | src/dv/plugin_transport_dv.c | 48 |
1 files changed, 23 insertions, 25 deletions
diff --git a/src/dv/plugin_transport_dv.c b/src/dv/plugin_transport_dv.c index 9d1e06777..76c823b17 100644 --- a/src/dv/plugin_transport_dv.c +++ b/src/dv/plugin_transport_dv.c | |||
@@ -27,10 +27,8 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "platform.h" | 29 | #include "platform.h" |
30 | #include "gnunet_util_lib.h" | ||
30 | #include "gnunet_protocols.h" | 31 | #include "gnunet_protocols.h" |
31 | #include "gnunet_connection_lib.h" | ||
32 | #include "gnunet_server_lib.h" | ||
33 | #include "gnunet_service_lib.h" | ||
34 | #include "gnunet_statistics_service.h" | 32 | #include "gnunet_statistics_service.h" |
35 | #include "gnunet_dv_service.h" | 33 | #include "gnunet_dv_service.h" |
36 | #include "gnunet_transport_service.h" | 34 | #include "gnunet_transport_service.h" |
@@ -146,7 +144,7 @@ struct Plugin | |||
146 | /** | 144 | /** |
147 | * Hash map of sessions (active and inactive). | 145 | * Hash map of sessions (active and inactive). |
148 | */ | 146 | */ |
149 | struct GNUNET_CONTAINER_MultiHashMap *sessions; | 147 | struct GNUNET_CONTAINER_MultiPeerMap *sessions; |
150 | 148 | ||
151 | /** | 149 | /** |
152 | * Copy of the handler array where the closures are | 150 | * Copy of the handler array where the closures are |
@@ -236,8 +234,8 @@ handle_dv_message_received (void *cls, | |||
236 | struct GNUNET_ATS_Information ats; | 234 | struct GNUNET_ATS_Information ats; |
237 | struct Session *session; | 235 | struct Session *session; |
238 | 236 | ||
239 | session = GNUNET_CONTAINER_multihashmap_get (plugin->sessions, | 237 | session = GNUNET_CONTAINER_multipeermap_get (plugin->sessions, |
240 | &sender->hashPubKey); | 238 | sender); |
241 | if (NULL == session) | 239 | if (NULL == session) |
242 | { | 240 | { |
243 | GNUNET_break (0); | 241 | GNUNET_break (0); |
@@ -280,8 +278,8 @@ handle_dv_connect (void *cls, | |||
280 | struct Plugin *plugin = cls; | 278 | struct Plugin *plugin = cls; |
281 | struct Session *session; | 279 | struct Session *session; |
282 | 280 | ||
283 | session = GNUNET_CONTAINER_multihashmap_get (plugin->sessions, | 281 | session = GNUNET_CONTAINER_multipeermap_get (plugin->sessions, |
284 | &peer->hashPubKey); | 282 | peer); |
285 | if (NULL != session) | 283 | if (NULL != session) |
286 | { | 284 | { |
287 | GNUNET_break (0); | 285 | GNUNET_break (0); |
@@ -294,8 +292,8 @@ handle_dv_connect (void *cls, | |||
294 | session->sender = *peer; | 292 | session->sender = *peer; |
295 | session->distance = distance; | 293 | session->distance = distance; |
296 | GNUNET_assert (GNUNET_YES == | 294 | GNUNET_assert (GNUNET_YES == |
297 | GNUNET_CONTAINER_multihashmap_put (plugin->sessions, | 295 | GNUNET_CONTAINER_multipeermap_put (plugin->sessions, |
298 | &session->sender.hashPubKey, | 296 | &session->sender, |
299 | session, | 297 | session, |
300 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); | 298 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); |
301 | } | 299 | } |
@@ -316,8 +314,8 @@ handle_dv_distance_changed (void *cls, | |||
316 | struct Plugin *plugin = cls; | 314 | struct Plugin *plugin = cls; |
317 | struct Session *session; | 315 | struct Session *session; |
318 | 316 | ||
319 | session = GNUNET_CONTAINER_multihashmap_get (plugin->sessions, | 317 | session = GNUNET_CONTAINER_multipeermap_get (plugin->sessions, |
320 | &peer->hashPubKey); | 318 | peer); |
321 | if (NULL == session) | 319 | if (NULL == session) |
322 | { | 320 | { |
323 | GNUNET_break (0); | 321 | GNUNET_break (0); |
@@ -342,8 +340,8 @@ free_session (struct Session *session) | |||
342 | struct PendingRequest *pr; | 340 | struct PendingRequest *pr; |
343 | 341 | ||
344 | GNUNET_assert (GNUNET_YES == | 342 | GNUNET_assert (GNUNET_YES == |
345 | GNUNET_CONTAINER_multihashmap_remove (plugin->sessions, | 343 | GNUNET_CONTAINER_multipeermap_remove (plugin->sessions, |
346 | &session->sender.hashPubKey, | 344 | &session->sender, |
347 | session)); | 345 | session)); |
348 | if (GNUNET_YES == session->active) | 346 | if (GNUNET_YES == session->active) |
349 | plugin->env->session_end (plugin->env->cls, | 347 | plugin->env->session_end (plugin->env->cls, |
@@ -379,8 +377,8 @@ handle_dv_disconnect (void *cls, | |||
379 | struct Plugin *plugin = cls; | 377 | struct Plugin *plugin = cls; |
380 | struct Session *session; | 378 | struct Session *session; |
381 | 379 | ||
382 | session = GNUNET_CONTAINER_multihashmap_get (plugin->sessions, | 380 | session = GNUNET_CONTAINER_multipeermap_get (plugin->sessions, |
383 | &peer->hashPubKey); | 381 | peer); |
384 | if (NULL == session) | 382 | if (NULL == session) |
385 | return; /* nothing to do */ | 383 | return; /* nothing to do */ |
386 | free_session (session); | 384 | free_session (session); |
@@ -486,8 +484,8 @@ dv_plugin_disconnect (void *cls, const struct GNUNET_PeerIdentity *target) | |||
486 | struct Session *session; | 484 | struct Session *session; |
487 | struct PendingRequest *pr; | 485 | struct PendingRequest *pr; |
488 | 486 | ||
489 | session = GNUNET_CONTAINER_multihashmap_get (plugin->sessions, | 487 | session = GNUNET_CONTAINER_multipeermap_get (plugin->sessions, |
490 | &target->hashPubKey); | 488 | target); |
491 | if (NULL == session) | 489 | if (NULL == session) |
492 | return; /* nothing to do */ | 490 | return; /* nothing to do */ |
493 | while (NULL != (pr = session->pr_head)) | 491 | while (NULL != (pr = session->pr_head)) |
@@ -599,8 +597,8 @@ dv_get_session (void *cls, | |||
599 | 597 | ||
600 | if (0 != address->address_length) | 598 | if (0 != address->address_length) |
601 | return NULL; | 599 | return NULL; |
602 | session = GNUNET_CONTAINER_multihashmap_get (plugin->sessions, | 600 | session = GNUNET_CONTAINER_multipeermap_get (plugin->sessions, |
603 | &address->peer.hashPubKey); | 601 | &address->peer); |
604 | if (NULL == session) | 602 | if (NULL == session) |
605 | return NULL; /* not valid right now */ | 603 | return NULL; /* not valid right now */ |
606 | session->active = GNUNET_YES; | 604 | session->active = GNUNET_YES; |
@@ -672,7 +670,7 @@ libgnunet_plugin_transport_dv_init (void *cls) | |||
672 | 670 | ||
673 | plugin = GNUNET_new (struct Plugin); | 671 | plugin = GNUNET_new (struct Plugin); |
674 | plugin->env = env; | 672 | plugin->env = env; |
675 | plugin->sessions = GNUNET_CONTAINER_multihashmap_create (1024 * 8, GNUNET_YES); | 673 | plugin->sessions = GNUNET_CONTAINER_multipeermap_create (1024 * 8, GNUNET_YES); |
676 | plugin->mst = GNUNET_SERVER_mst_create (&unbox_cb, | 674 | plugin->mst = GNUNET_SERVER_mst_create (&unbox_cb, |
677 | plugin); | 675 | plugin); |
678 | plugin->dvh = GNUNET_DV_service_connect (env->cfg, | 676 | plugin->dvh = GNUNET_DV_service_connect (env->cfg, |
@@ -683,7 +681,7 @@ libgnunet_plugin_transport_dv_init (void *cls) | |||
683 | &handle_dv_message_received); | 681 | &handle_dv_message_received); |
684 | if (NULL == plugin->dvh) | 682 | if (NULL == plugin->dvh) |
685 | { | 683 | { |
686 | GNUNET_CONTAINER_multihashmap_destroy (plugin->sessions); | 684 | GNUNET_CONTAINER_multipeermap_destroy (plugin->sessions); |
687 | GNUNET_SERVER_mst_destroy (plugin->mst); | 685 | GNUNET_SERVER_mst_destroy (plugin->mst); |
688 | GNUNET_free (plugin); | 686 | GNUNET_free (plugin); |
689 | return NULL; | 687 | return NULL; |
@@ -712,7 +710,7 @@ libgnunet_plugin_transport_dv_init (void *cls) | |||
712 | */ | 710 | */ |
713 | static int | 711 | static int |
714 | free_session_iterator (void *cls, | 712 | free_session_iterator (void *cls, |
715 | const struct GNUNET_HashCode *key, | 713 | const struct GNUNET_PeerIdentity *key, |
716 | void *value) | 714 | void *value) |
717 | { | 715 | { |
718 | struct Session *session = value; | 716 | struct Session *session = value; |
@@ -735,10 +733,10 @@ libgnunet_plugin_transport_dv_done (void *cls) | |||
735 | struct Plugin *plugin = api->cls; | 733 | struct Plugin *plugin = api->cls; |
736 | 734 | ||
737 | GNUNET_DV_service_disconnect (plugin->dvh); | 735 | GNUNET_DV_service_disconnect (plugin->dvh); |
738 | GNUNET_CONTAINER_multihashmap_iterate (plugin->sessions, | 736 | GNUNET_CONTAINER_multipeermap_iterate (plugin->sessions, |
739 | &free_session_iterator, | 737 | &free_session_iterator, |
740 | NULL); | 738 | NULL); |
741 | GNUNET_CONTAINER_multihashmap_destroy (plugin->sessions); | 739 | GNUNET_CONTAINER_multipeermap_destroy (plugin->sessions); |
742 | GNUNET_SERVER_mst_destroy (plugin->mst); | 740 | GNUNET_SERVER_mst_destroy (plugin->mst); |
743 | GNUNET_free (plugin); | 741 | GNUNET_free (plugin); |
744 | GNUNET_free (api); | 742 | GNUNET_free (api); |