diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-09-30 22:01:13 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-09-30 22:01:13 +0000 |
commit | 7abf844d0d4de319f2b093d50b0334af9a9d3bda (patch) | |
tree | 212272d6aaf9e5530ce44418149b9158f1eb0f7c /src/fs | |
parent | 8556fe9ebd0c4f8e63577a43155ffede20607f41 (diff) | |
download | gnunet-7abf844d0d4de319f2b093d50b0334af9a9d3bda.tar.gz gnunet-7abf844d0d4de319f2b093d50b0334af9a9d3bda.zip |
-fixing build issues in fs/set related to #3047
Diffstat (limited to 'src/fs')
-rw-r--r-- | src/fs/fs.h | 2 | ||||
-rw-r--r-- | src/fs/fs_api.h | 2 | ||||
-rw-r--r-- | src/fs/fs_download.c | 2 | ||||
-rw-r--r-- | src/fs/fs_uri.c | 14 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_cp.c | 52 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_mesh_client.c | 22 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pe.c | 18 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_pr.c | 1 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs_push.c | 4 |
9 files changed, 63 insertions, 54 deletions
diff --git a/src/fs/fs.h b/src/fs/fs.h index c4a3e00ae..ae6ca489a 100644 --- a/src/fs/fs.h +++ b/src/fs/fs.h | |||
@@ -240,7 +240,7 @@ struct SearchMessage | |||
240 | * <p> | 240 | * <p> |
241 | * Otherwise, "target" must be all zeros. | 241 | * Otherwise, "target" must be all zeros. |
242 | */ | 242 | */ |
243 | struct GNUNET_HashCode target; | 243 | struct GNUNET_PeerIdentity target; |
244 | 244 | ||
245 | /** | 245 | /** |
246 | * Hash of the public key for UBLOCKs; Hash of | 246 | * Hash of the public key for UBLOCKs; Hash of |
diff --git a/src/fs/fs_api.h b/src/fs/fs_api.h index 5cc9d6ed9..d8ea21c54 100644 --- a/src/fs/fs_api.h +++ b/src/fs/fs_api.h | |||
@@ -120,7 +120,7 @@ struct Location | |||
120 | /** | 120 | /** |
121 | * Identity of the peer sharing the file. | 121 | * Identity of the peer sharing the file. |
122 | */ | 122 | */ |
123 | struct GNUNET_CRYPTO_EccPublicSignKey peer; | 123 | struct GNUNET_PeerIdentity peer; |
124 | 124 | ||
125 | /** | 125 | /** |
126 | * Time when this location URI expires. | 126 | * Time when this location URI expires. |
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c index 282198cd3..49c83bdc6 100644 --- a/src/fs/fs_download.c +++ b/src/fs/fs_download.c | |||
@@ -1325,7 +1325,7 @@ transmit_download_request (void *cls, size_t size, void *buf) | |||
1325 | else | 1325 | else |
1326 | sm->type = htonl (GNUNET_BLOCK_TYPE_FS_IBLOCK); | 1326 | sm->type = htonl (GNUNET_BLOCK_TYPE_FS_IBLOCK); |
1327 | sm->anonymity_level = htonl (dc->anonymity); | 1327 | sm->anonymity_level = htonl (dc->anonymity); |
1328 | sm->target = dc->target.hashPubKey; | 1328 | sm->target = dc->target; |
1329 | sm->query = dr->chk.query; | 1329 | sm->query = dr->chk.query; |
1330 | GNUNET_CONTAINER_DLL_remove (dc->pending_head, dc->pending_tail, dr); | 1330 | GNUNET_CONTAINER_DLL_remove (dc->pending_head, dc->pending_tail, dr); |
1331 | dr->is_pending = GNUNET_NO; | 1331 | dr->is_pending = GNUNET_NO; |
diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c index 67ce6d530..4b25e91ea 100644 --- a/src/fs/fs_uri.c +++ b/src/fs/fs_uri.c | |||
@@ -532,7 +532,7 @@ struct LocUriAssembly | |||
532 | /** | 532 | /** |
533 | * Peer offering the file. | 533 | * Peer offering the file. |
534 | */ | 534 | */ |
535 | struct GNUNET_CRYPTO_EccPublicSignKey peer; | 535 | struct GNUNET_PeerIdentity peer; |
536 | 536 | ||
537 | }; | 537 | }; |
538 | GNUNET_NETWORK_STRUCT_END | 538 | GNUNET_NETWORK_STRUCT_END |
@@ -642,7 +642,7 @@ uri_loc_parse (const char *s, char **emsg) | |||
642 | ass.exptime = GNUNET_TIME_absolute_hton (et); | 642 | ass.exptime = GNUNET_TIME_absolute_hton (et); |
643 | if (GNUNET_OK != | 643 | if (GNUNET_OK != |
644 | GNUNET_CRYPTO_ecc_verify (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT, | 644 | GNUNET_CRYPTO_ecc_verify (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT, |
645 | &ass.purpose, &sig, &ass.peer)) | 645 | &ass.purpose, &sig, &ass.peer.public_key)) |
646 | { | 646 | { |
647 | *emsg = | 647 | *emsg = |
648 | GNUNET_strdup (_("SKS URI malformed (signature failed validation)")); | 648 | GNUNET_strdup (_("SKS URI malformed (signature failed validation)")); |
@@ -832,7 +832,7 @@ GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri, | |||
832 | * | 832 | * |
833 | * @param uri the location URI to inspect | 833 | * @param uri the location URI to inspect |
834 | * @param peer where to store the identify of the peer (presumably) offering the content | 834 | * @param peer where to store the identify of the peer (presumably) offering the content |
835 | * @return GNUNET_SYSERR if this is not a location URI, otherwise GNUNET_OK | 835 | * @return #GNUNET_SYSERR if this is not a location URI, otherwise #GNUNET_OK |
836 | */ | 836 | */ |
837 | int | 837 | int |
838 | GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri, | 838 | GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri, |
@@ -840,9 +840,7 @@ GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri, | |||
840 | { | 840 | { |
841 | if (uri->type != GNUNET_FS_URI_LOC) | 841 | if (uri->type != GNUNET_FS_URI_LOC) |
842 | return GNUNET_SYSERR; | 842 | return GNUNET_SYSERR; |
843 | GNUNET_CRYPTO_hash (&uri->data.loc.peer, | 843 | *peer = uri->data.loc.peer; |
844 | sizeof (struct GNUNET_CRYPTO_EccPublicSignKey), | ||
845 | &peer->hashPubKey); | ||
846 | return GNUNET_OK; | 844 | return GNUNET_OK; |
847 | } | 845 | } |
848 | 846 | ||
@@ -927,12 +925,12 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri, | |||
927 | ass.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT); | 925 | ass.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_PEER_PLACEMENT); |
928 | ass.exptime = GNUNET_TIME_absolute_hton (et); | 926 | ass.exptime = GNUNET_TIME_absolute_hton (et); |
929 | ass.fi = baseUri->data.chk; | 927 | ass.fi = baseUri->data.chk; |
930 | ass.peer = my_public_key; | 928 | ass.peer.public_key = my_public_key; |
931 | uri = GNUNET_new (struct GNUNET_FS_Uri); | 929 | uri = GNUNET_new (struct GNUNET_FS_Uri); |
932 | uri->type = GNUNET_FS_URI_LOC; | 930 | uri->type = GNUNET_FS_URI_LOC; |
933 | uri->data.loc.fi = baseUri->data.chk; | 931 | uri->data.loc.fi = baseUri->data.chk; |
934 | uri->data.loc.expirationTime = et; | 932 | uri->data.loc.expirationTime = et; |
935 | uri->data.loc.peer = my_public_key; | 933 | uri->data.loc.peer.public_key = my_public_key; |
936 | GNUNET_assert (GNUNET_OK == | 934 | GNUNET_assert (GNUNET_OK == |
937 | GNUNET_CRYPTO_ecc_sign (my_private_key, &ass.purpose, | 935 | GNUNET_CRYPTO_ecc_sign (my_private_key, &ass.purpose, |
938 | &uri->data.loc.contentSignature)); | 936 | &uri->data.loc.contentSignature)); |
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c index f5b5213bc..a9e950363 100644 --- a/src/fs/gnunet-service-fs_cp.c +++ b/src/fs/gnunet-service-fs_cp.c | |||
@@ -24,6 +24,7 @@ | |||
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
25 | */ | 25 | */ |
26 | #include "platform.h" | 26 | #include "platform.h" |
27 | #include "gnunet_util_lib.h" | ||
27 | #include "gnunet_load_lib.h" | 28 | #include "gnunet_load_lib.h" |
28 | #include "gnunet-service-fs.h" | 29 | #include "gnunet-service-fs.h" |
29 | #include "gnunet-service-fs_cp.h" | 30 | #include "gnunet-service-fs_cp.h" |
@@ -307,7 +308,7 @@ struct GSF_ConnectedPeer | |||
307 | /** | 308 | /** |
308 | * Map from peer identities to 'struct GSF_ConnectPeer' entries. | 309 | * Map from peer identities to 'struct GSF_ConnectPeer' entries. |
309 | */ | 310 | */ |
310 | static struct GNUNET_CONTAINER_MultiHashMap *cp_map; | 311 | static struct GNUNET_CONTAINER_MultiPeerMap *cp_map; |
311 | 312 | ||
312 | /** | 313 | /** |
313 | * Where do we store respect information? | 314 | * Where do we store respect information? |
@@ -325,11 +326,13 @@ static char *respectDirectory; | |||
325 | static char * | 326 | static char * |
326 | get_respect_filename (const struct GNUNET_PeerIdentity *id) | 327 | get_respect_filename (const struct GNUNET_PeerIdentity *id) |
327 | { | 328 | { |
328 | struct GNUNET_CRYPTO_HashAsciiEncoded fil; | ||
329 | char *fn; | 329 | char *fn; |
330 | 330 | ||
331 | GNUNET_CRYPTO_hash_to_enc (&id->hashPubKey, &fil); | 331 | GNUNET_asprintf (&fn, |
332 | GNUNET_asprintf (&fn, "%s%s%s", respectDirectory, DIR_SEPARATOR_STR, &fil); | 332 | "%s%s%s", |
333 | respectDirectory, | ||
334 | DIR_SEPARATOR_STR, | ||
335 | GNUNET_i2s_full (id)); | ||
333 | return fn; | 336 | return fn; |
334 | } | 337 | } |
335 | 338 | ||
@@ -594,12 +597,12 @@ GSF_peer_connect_handler_ (const struct GNUNET_PeerIdentity *peer) | |||
594 | GNUNET_free (fn); | 597 | GNUNET_free (fn); |
595 | cp->request_map = GNUNET_CONTAINER_multihashmap_create (128, GNUNET_NO); | 598 | cp->request_map = GNUNET_CONTAINER_multihashmap_create (128, GNUNET_NO); |
596 | GNUNET_break (GNUNET_OK == | 599 | GNUNET_break (GNUNET_OK == |
597 | GNUNET_CONTAINER_multihashmap_put (cp_map, | 600 | GNUNET_CONTAINER_multipeermap_put (cp_map, |
598 | &GSF_connected_peer_get_identity2_ (cp)->hashPubKey, | 601 | GSF_connected_peer_get_identity2_ (cp), |
599 | cp, | 602 | cp, |
600 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); | 603 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); |
601 | GNUNET_STATISTICS_set (GSF_stats, gettext_noop ("# peers connected"), | 604 | GNUNET_STATISTICS_set (GSF_stats, gettext_noop ("# peers connected"), |
602 | GNUNET_CONTAINER_multihashmap_size (cp_map), | 605 | GNUNET_CONTAINER_multipeermap_size (cp_map), |
603 | GNUNET_NO); | 606 | GNUNET_NO); |
604 | GSF_push_start_ (cp); | 607 | GSF_push_start_ (cp); |
605 | return cp; | 608 | return cp; |
@@ -643,7 +646,7 @@ GSF_peer_get_ (const struct GNUNET_PeerIdentity *peer) | |||
643 | { | 646 | { |
644 | if (NULL == cp_map) | 647 | if (NULL == cp_map) |
645 | return NULL; | 648 | return NULL; |
646 | return GNUNET_CONTAINER_multihashmap_get (cp_map, &peer->hashPubKey); | 649 | return GNUNET_CONTAINER_multipeermap_get (cp_map, peer); |
647 | } | 650 | } |
648 | 651 | ||
649 | 652 | ||
@@ -1490,10 +1493,11 @@ GSF_peer_disconnect_handler_ (void *cls, const struct GNUNET_PeerIdentity *peer) | |||
1490 | return; /* must have been disconnect from core with | 1493 | return; /* must have been disconnect from core with |
1491 | * 'peer' == my_id, ignore */ | 1494 | * 'peer' == my_id, ignore */ |
1492 | GNUNET_assert (GNUNET_YES == | 1495 | GNUNET_assert (GNUNET_YES == |
1493 | GNUNET_CONTAINER_multihashmap_remove (cp_map, | 1496 | GNUNET_CONTAINER_multipeermap_remove (cp_map, |
1494 | &peer->hashPubKey, cp)); | 1497 | peer, |
1498 | cp)); | ||
1495 | GNUNET_STATISTICS_set (GSF_stats, gettext_noop ("# peers connected"), | 1499 | GNUNET_STATISTICS_set (GSF_stats, gettext_noop ("# peers connected"), |
1496 | GNUNET_CONTAINER_multihashmap_size (cp_map), | 1500 | GNUNET_CONTAINER_multipeermap_size (cp_map), |
1497 | GNUNET_NO); | 1501 | GNUNET_NO); |
1498 | if (NULL != cp->migration_pth) | 1502 | if (NULL != cp->migration_pth) |
1499 | { | 1503 | { |
@@ -1579,7 +1583,7 @@ struct IterationContext | |||
1579 | * @return #GNUNET_YES to continue iteration | 1583 | * @return #GNUNET_YES to continue iteration |
1580 | */ | 1584 | */ |
1581 | static int | 1585 | static int |
1582 | call_iterator (void *cls, const struct GNUNET_HashCode * key, void *value) | 1586 | call_iterator (void *cls, const struct GNUNET_PeerIdentity * key, void *value) |
1583 | { | 1587 | { |
1584 | struct IterationContext *ic = cls; | 1588 | struct IterationContext *ic = cls; |
1585 | struct GSF_ConnectedPeer *cp = value; | 1589 | struct GSF_ConnectedPeer *cp = value; |
@@ -1602,7 +1606,7 @@ GSF_iterate_connected_peers_ (GSF_ConnectedPeerIterator it, void *it_cls) | |||
1602 | 1606 | ||
1603 | ic.it = it; | 1607 | ic.it = it; |
1604 | ic.it_cls = it_cls; | 1608 | ic.it_cls = it_cls; |
1605 | GNUNET_CONTAINER_multihashmap_iterate (cp_map, &call_iterator, &ic); | 1609 | GNUNET_CONTAINER_multipeermap_iterate (cp_map, &call_iterator, &ic); |
1606 | } | 1610 | } |
1607 | 1611 | ||
1608 | 1612 | ||
@@ -1709,7 +1713,7 @@ GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp, | |||
1709 | * @return GNUNET_OK to continue iteration | 1713 | * @return GNUNET_OK to continue iteration |
1710 | */ | 1714 | */ |
1711 | static int | 1715 | static int |
1712 | flush_respect (void *cls, const struct GNUNET_HashCode * key, void *value) | 1716 | flush_respect (void *cls, const struct GNUNET_PeerIdentity * key, void *value) |
1713 | { | 1717 | { |
1714 | struct GSF_ConnectedPeer *cp = value; | 1718 | struct GSF_ConnectedPeer *cp = value; |
1715 | char *fn; | 1719 | char *fn; |
@@ -1772,7 +1776,7 @@ cron_flush_respect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1772 | 1776 | ||
1773 | if (NULL == cp_map) | 1777 | if (NULL == cp_map) |
1774 | return; | 1778 | return; |
1775 | GNUNET_CONTAINER_multihashmap_iterate (cp_map, &flush_respect, NULL); | 1779 | GNUNET_CONTAINER_multipeermap_iterate (cp_map, &flush_respect, NULL); |
1776 | if (NULL == tc) | 1780 | if (NULL == tc) |
1777 | return; | 1781 | return; |
1778 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 1782 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
@@ -1789,7 +1793,7 @@ cron_flush_respect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1789 | void | 1793 | void |
1790 | GSF_connected_peer_init_ () | 1794 | GSF_connected_peer_init_ () |
1791 | { | 1795 | { |
1792 | cp_map = GNUNET_CONTAINER_multihashmap_create (128, GNUNET_YES); | 1796 | cp_map = GNUNET_CONTAINER_multipeermap_create (128, GNUNET_YES); |
1793 | GNUNET_assert (GNUNET_OK == | 1797 | GNUNET_assert (GNUNET_OK == |
1794 | GNUNET_CONFIGURATION_get_value_filename (GSF_cfg, "fs", | 1798 | GNUNET_CONFIGURATION_get_value_filename (GSF_cfg, "fs", |
1795 | "RESPECT", | 1799 | "RESPECT", |
@@ -1809,9 +1813,11 @@ GSF_connected_peer_init_ () | |||
1809 | * @return #GNUNET_YES (we should continue to iterate) | 1813 | * @return #GNUNET_YES (we should continue to iterate) |
1810 | */ | 1814 | */ |
1811 | static int | 1815 | static int |
1812 | clean_peer (void *cls, const struct GNUNET_HashCode * key, void *value) | 1816 | clean_peer (void *cls, |
1817 | const struct GNUNET_PeerIdentity *key, | ||
1818 | void *value) | ||
1813 | { | 1819 | { |
1814 | GSF_peer_disconnect_handler_ (NULL, (const struct GNUNET_PeerIdentity *) key); | 1820 | GSF_peer_disconnect_handler_ (NULL, key); |
1815 | return GNUNET_YES; | 1821 | return GNUNET_YES; |
1816 | } | 1822 | } |
1817 | 1823 | ||
@@ -1823,8 +1829,8 @@ void | |||
1823 | GSF_connected_peer_done_ () | 1829 | GSF_connected_peer_done_ () |
1824 | { | 1830 | { |
1825 | cron_flush_respect (NULL, NULL); | 1831 | cron_flush_respect (NULL, NULL); |
1826 | GNUNET_CONTAINER_multihashmap_iterate (cp_map, &clean_peer, NULL); | 1832 | GNUNET_CONTAINER_multipeermap_iterate (cp_map, &clean_peer, NULL); |
1827 | GNUNET_CONTAINER_multihashmap_destroy (cp_map); | 1833 | GNUNET_CONTAINER_multipeermap_destroy (cp_map); |
1828 | cp_map = NULL; | 1834 | cp_map = NULL; |
1829 | GNUNET_free (respectDirectory); | 1835 | GNUNET_free (respectDirectory); |
1830 | respectDirectory = NULL; | 1836 | respectDirectory = NULL; |
@@ -1840,7 +1846,9 @@ GSF_connected_peer_done_ () | |||
1840 | * @return #GNUNET_YES (we should continue to iterate) | 1846 | * @return #GNUNET_YES (we should continue to iterate) |
1841 | */ | 1847 | */ |
1842 | static int | 1848 | static int |
1843 | clean_local_client (void *cls, const struct GNUNET_HashCode * key, void *value) | 1849 | clean_local_client (void *cls, |
1850 | const struct GNUNET_PeerIdentity *key, | ||
1851 | void *value) | ||
1844 | { | 1852 | { |
1845 | const struct GSF_LocalClient *lc = cls; | 1853 | const struct GSF_LocalClient *lc = cls; |
1846 | struct GSF_ConnectedPeer *cp = value; | 1854 | struct GSF_ConnectedPeer *cp = value; |
@@ -1864,7 +1872,7 @@ GSF_handle_local_client_disconnect_ (const struct GSF_LocalClient *lc) | |||
1864 | { | 1872 | { |
1865 | if (NULL == cp_map) | 1873 | if (NULL == cp_map) |
1866 | return; /* already cleaned up */ | 1874 | return; /* already cleaned up */ |
1867 | GNUNET_CONTAINER_multihashmap_iterate (cp_map, &clean_local_client, | 1875 | GNUNET_CONTAINER_multipeermap_iterate (cp_map, &clean_local_client, |
1868 | (void *) lc); | 1876 | (void *) lc); |
1869 | } | 1877 | } |
1870 | 1878 | ||
diff --git a/src/fs/gnunet-service-fs_mesh_client.c b/src/fs/gnunet-service-fs_mesh_client.c index d31509857..ffc3c6179 100644 --- a/src/fs/gnunet-service-fs_mesh_client.c +++ b/src/fs/gnunet-service-fs_mesh_client.c | |||
@@ -161,7 +161,7 @@ static struct GNUNET_MESH_Handle *mesh_handle; | |||
161 | * Map from peer identities to 'struct MeshHandles' with mesh | 161 | * Map from peer identities to 'struct MeshHandles' with mesh |
162 | * tunnels to those peers. | 162 | * tunnels to those peers. |
163 | */ | 163 | */ |
164 | static struct GNUNET_CONTAINER_MultiHashMap *mesh_map; | 164 | static struct GNUNET_CONTAINER_MultiPeerMap *mesh_map; |
165 | 165 | ||
166 | 166 | ||
167 | /* ********************* client-side code ************************* */ | 167 | /* ********************* client-side code ************************* */ |
@@ -504,8 +504,8 @@ get_mesh (const struct GNUNET_PeerIdentity *target) | |||
504 | { | 504 | { |
505 | struct MeshHandle *mh; | 505 | struct MeshHandle *mh; |
506 | 506 | ||
507 | mh = GNUNET_CONTAINER_multihashmap_get (mesh_map, | 507 | mh = GNUNET_CONTAINER_multipeermap_get (mesh_map, |
508 | &target->hashPubKey); | 508 | target); |
509 | if (NULL != mh) | 509 | if (NULL != mh) |
510 | { | 510 | { |
511 | if (GNUNET_SCHEDULER_NO_TASK != mh->timeout_task) | 511 | if (GNUNET_SCHEDULER_NO_TASK != mh->timeout_task) |
@@ -531,8 +531,8 @@ get_mesh (const struct GNUNET_PeerIdentity *target) | |||
531 | GNUNET_NO, | 531 | GNUNET_NO, |
532 | GNUNET_YES); | 532 | GNUNET_YES); |
533 | GNUNET_assert (GNUNET_OK == | 533 | GNUNET_assert (GNUNET_OK == |
534 | GNUNET_CONTAINER_multihashmap_put (mesh_map, | 534 | GNUNET_CONTAINER_multipeermap_put (mesh_map, |
535 | &mh->target.hashPubKey, | 535 | &mh->target, |
536 | mh, | 536 | mh, |
537 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); | 537 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); |
538 | return mh; | 538 | return mh; |
@@ -669,8 +669,8 @@ cleaner_cb (void *cls, | |||
669 | if (GNUNET_SCHEDULER_NO_TASK != mh->reset_task) | 669 | if (GNUNET_SCHEDULER_NO_TASK != mh->reset_task) |
670 | GNUNET_SCHEDULER_cancel (mh->reset_task); | 670 | GNUNET_SCHEDULER_cancel (mh->reset_task); |
671 | GNUNET_assert (GNUNET_OK == | 671 | GNUNET_assert (GNUNET_OK == |
672 | GNUNET_CONTAINER_multihashmap_remove (mesh_map, | 672 | GNUNET_CONTAINER_multipeermap_remove (mesh_map, |
673 | &mh->target.hashPubKey, | 673 | &mh->target, |
674 | mh)); | 674 | mh)); |
675 | GNUNET_CONTAINER_multihashmap_destroy (mh->waiting_map); | 675 | GNUNET_CONTAINER_multihashmap_destroy (mh->waiting_map); |
676 | GNUNET_free (mh); | 676 | GNUNET_free (mh); |
@@ -688,7 +688,7 @@ GSF_mesh_start_client () | |||
688 | { NULL, 0, 0 } | 688 | { NULL, 0, 0 } |
689 | }; | 689 | }; |
690 | 690 | ||
691 | mesh_map = GNUNET_CONTAINER_multihashmap_create (16, GNUNET_YES); | 691 | mesh_map = GNUNET_CONTAINER_multipeermap_create (16, GNUNET_YES); |
692 | mesh_handle = GNUNET_MESH_connect (GSF_cfg, | 692 | mesh_handle = GNUNET_MESH_connect (GSF_cfg, |
693 | NULL, | 693 | NULL, |
694 | NULL, | 694 | NULL, |
@@ -708,7 +708,7 @@ GSF_mesh_start_client () | |||
708 | */ | 708 | */ |
709 | static int | 709 | static int |
710 | release_meshs (void *cls, | 710 | release_meshs (void *cls, |
711 | const struct GNUNET_HashCode *key, | 711 | const struct GNUNET_PeerIdentity *key, |
712 | void *value) | 712 | void *value) |
713 | { | 713 | { |
714 | struct MeshHandle *mh = value; | 714 | struct MeshHandle *mh = value; |
@@ -731,10 +731,10 @@ release_meshs (void *cls, | |||
731 | void | 731 | void |
732 | GSF_mesh_stop_client () | 732 | GSF_mesh_stop_client () |
733 | { | 733 | { |
734 | GNUNET_CONTAINER_multihashmap_iterate (mesh_map, | 734 | GNUNET_CONTAINER_multipeermap_iterate (mesh_map, |
735 | &release_meshs, | 735 | &release_meshs, |
736 | NULL); | 736 | NULL); |
737 | GNUNET_CONTAINER_multihashmap_destroy (mesh_map); | 737 | GNUNET_CONTAINER_multipeermap_destroy (mesh_map); |
738 | mesh_map = NULL; | 738 | mesh_map = NULL; |
739 | if (NULL != mesh_handle) | 739 | if (NULL != mesh_handle) |
740 | { | 740 | { |
diff --git a/src/fs/gnunet-service-fs_pe.c b/src/fs/gnunet-service-fs_pe.c index 21f028a2d..9e92be2ed 100644 --- a/src/fs/gnunet-service-fs_pe.c +++ b/src/fs/gnunet-service-fs_pe.c | |||
@@ -203,7 +203,7 @@ struct PeerPlan | |||
203 | /** | 203 | /** |
204 | * Hash map from peer identities to PeerPlans. | 204 | * Hash map from peer identities to PeerPlans. |
205 | */ | 205 | */ |
206 | static struct GNUNET_CONTAINER_MultiHashMap *plans; | 206 | static struct GNUNET_CONTAINER_MultiPeerMap *plans; |
207 | 207 | ||
208 | /** | 208 | /** |
209 | * Sum of all transmission counters (equals total delay for all plan entries). | 209 | * Sum of all transmission counters (equals total delay for all plan entries). |
@@ -584,7 +584,7 @@ GSF_plan_add_ (struct GSF_ConnectedPeer *cp, struct GSF_PendingRequest *pr) | |||
584 | 584 | ||
585 | GNUNET_assert (NULL != cp); | 585 | GNUNET_assert (NULL != cp); |
586 | id = GSF_connected_peer_get_identity2_ (cp); | 586 | id = GSF_connected_peer_get_identity2_ (cp); |
587 | pp = GNUNET_CONTAINER_multihashmap_get (plans, &id->hashPubKey); | 587 | pp = GNUNET_CONTAINER_multipeermap_get (plans, id); |
588 | if (NULL == pp) | 588 | if (NULL == pp) |
589 | { | 589 | { |
590 | pp = GNUNET_new (struct PeerPlan); | 590 | pp = GNUNET_new (struct PeerPlan); |
@@ -594,8 +594,8 @@ GSF_plan_add_ (struct GSF_ConnectedPeer *cp, struct GSF_PendingRequest *pr) | |||
594 | pp->delay_heap = | 594 | pp->delay_heap = |
595 | GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN); | 595 | GNUNET_CONTAINER_heap_create (GNUNET_CONTAINER_HEAP_ORDER_MIN); |
596 | pp->cp = cp; | 596 | pp->cp = cp; |
597 | GNUNET_CONTAINER_multihashmap_put (plans, | 597 | GNUNET_CONTAINER_multipeermap_put (plans, |
598 | &id->hashPubKey, pp, | 598 | id, pp, |
599 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); | 599 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY); |
600 | } | 600 | } |
601 | mpc.merged = GNUNET_NO; | 601 | mpc.merged = GNUNET_NO; |
@@ -648,11 +648,11 @@ GSF_plan_notify_peer_disconnect_ (const struct GSF_ConnectedPeer *cp) | |||
648 | struct GSF_PendingRequestPlanBijection *bi; | 648 | struct GSF_PendingRequestPlanBijection *bi; |
649 | 649 | ||
650 | id = GSF_connected_peer_get_identity2_ (cp); | 650 | id = GSF_connected_peer_get_identity2_ (cp); |
651 | pp = GNUNET_CONTAINER_multihashmap_get (plans, &id->hashPubKey); | 651 | pp = GNUNET_CONTAINER_multipeermap_get (plans, id); |
652 | if (NULL == pp) | 652 | if (NULL == pp) |
653 | return; /* nothing was ever planned for this peer */ | 653 | return; /* nothing was ever planned for this peer */ |
654 | GNUNET_assert (GNUNET_YES == | 654 | GNUNET_assert (GNUNET_YES == |
655 | GNUNET_CONTAINER_multihashmap_remove (plans, &id->hashPubKey, | 655 | GNUNET_CONTAINER_multipeermap_remove (plans, id, |
656 | pp)); | 656 | pp)); |
657 | if (NULL != pp->pth) | 657 | if (NULL != pp->pth) |
658 | { | 658 | { |
@@ -777,7 +777,7 @@ GSF_plan_notify_request_done_ (struct GSF_PendingRequest *pr) | |||
777 | void | 777 | void |
778 | GSF_plan_init () | 778 | GSF_plan_init () |
779 | { | 779 | { |
780 | plans = GNUNET_CONTAINER_multihashmap_create (256, GNUNET_YES); | 780 | plans = GNUNET_CONTAINER_multipeermap_create (256, GNUNET_YES); |
781 | } | 781 | } |
782 | 782 | ||
783 | 783 | ||
@@ -787,8 +787,8 @@ GSF_plan_init () | |||
787 | void | 787 | void |
788 | GSF_plan_done () | 788 | GSF_plan_done () |
789 | { | 789 | { |
790 | GNUNET_assert (0 == GNUNET_CONTAINER_multihashmap_size (plans)); | 790 | GNUNET_assert (0 == GNUNET_CONTAINER_multipeermap_size (plans)); |
791 | GNUNET_CONTAINER_multihashmap_destroy (plans); | 791 | GNUNET_CONTAINER_multipeermap_destroy (plans); |
792 | } | 792 | } |
793 | 793 | ||
794 | 794 | ||
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index 627d376ef..b624f536c 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c | |||
@@ -24,6 +24,7 @@ | |||
24 | * @author Christian Grothoff | 24 | * @author Christian Grothoff |
25 | */ | 25 | */ |
26 | #include "platform.h" | 26 | #include "platform.h" |
27 | #include "gnunet_util_lib.h" | ||
27 | #include "gnunet_load_lib.h" | 28 | #include "gnunet_load_lib.h" |
28 | #include "gnunet-service-fs.h" | 29 | #include "gnunet-service-fs.h" |
29 | #include "gnunet-service-fs_cp.h" | 30 | #include "gnunet-service-fs_cp.h" |
diff --git a/src/fs/gnunet-service-fs_push.c b/src/fs/gnunet-service-fs_push.c index 70c13f49f..c80dc8b08 100644 --- a/src/fs/gnunet-service-fs_push.c +++ b/src/fs/gnunet-service-fs_push.c | |||
@@ -329,6 +329,7 @@ score_content (struct MigrationReadyPeer *peer, | |||
329 | unsigned int i; | 329 | unsigned int i; |
330 | struct GSF_PeerPerformanceData *ppd; | 330 | struct GSF_PeerPerformanceData *ppd; |
331 | struct GNUNET_PeerIdentity id; | 331 | struct GNUNET_PeerIdentity id; |
332 | struct GNUNET_HashCode hc; | ||
332 | uint32_t dist; | 333 | uint32_t dist; |
333 | 334 | ||
334 | ppd = GSF_get_peer_performance_data_ (peer->peer); | 335 | ppd = GSF_get_peer_performance_data_ (peer->peer); |
@@ -337,7 +338,8 @@ score_content (struct MigrationReadyPeer *peer, | |||
337 | return -1; | 338 | return -1; |
338 | GNUNET_assert (0 != ppd->pid); | 339 | GNUNET_assert (0 != ppd->pid); |
339 | GNUNET_PEER_resolve (ppd->pid, &id); | 340 | GNUNET_PEER_resolve (ppd->pid, &id); |
340 | dist = GNUNET_CRYPTO_hash_distance_u32 (&block->query, &id.hashPubKey); | 341 | GNUNET_CRYPTO_hash (&id, sizeof (struct GNUNET_PeerIdentity), &hc); |
342 | dist = GNUNET_CRYPTO_hash_distance_u32 (&block->query, &hc); | ||
341 | /* closer distance, higher score: */ | 343 | /* closer distance, higher score: */ |
342 | return UINT32_MAX - dist; | 344 | return UINT32_MAX - dist; |
343 | } | 345 | } |