diff options
author | Nathan S. Evans <evans@in.tum.de> | 2011-02-16 16:24:32 +0000 |
---|---|---|
committer | Nathan S. Evans <evans@in.tum.de> | 2011-02-16 16:24:32 +0000 |
commit | 27a6cee72d7c479853acbeed0047534fd4566deb (patch) | |
tree | d932da0e35e14abb83480b508874fcc9d0efdab2 /src/core/core_api.c | |
parent | e054285d845aad88df678b60ee532d71d5115f4b (diff) | |
download | gnunet-27a6cee72d7c479853acbeed0047534fd4566deb.tar.gz gnunet-27a6cee72d7c479853acbeed0047534fd4566deb.zip |
remove double connect notify, add is connected optimization for peer iterate call
Diffstat (limited to 'src/core/core_api.c')
-rw-r--r-- | src/core/core_api.c | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/src/core/core_api.c b/src/core/core_api.c index 57bf64ad7..e9a38271b 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c | |||
@@ -1730,25 +1730,11 @@ GNUNET_CORE_peer_request_connect (struct GNUNET_CORE_Handle *h, | |||
1730 | struct GNUNET_CORE_PeerRequestHandle *ret; | 1730 | struct GNUNET_CORE_PeerRequestHandle *ret; |
1731 | struct ControlMessage *cm; | 1731 | struct ControlMessage *cm; |
1732 | struct ConnectMessage *msg; | 1732 | struct ConnectMessage *msg; |
1733 | struct PeerRecord *pr; | ||
1734 | static struct GNUNET_TRANSPORT_ATS_Information distance[2]; | ||
1735 | 1733 | ||
1736 | if (NULL != GNUNET_CONTAINER_multihashmap_get (h->peers, | 1734 | if (NULL != GNUNET_CONTAINER_multihashmap_get (h->peers, |
1737 | &peer->hashPubKey)) | 1735 | &peer->hashPubKey)) |
1738 | { | 1736 | return NULL; /* Already connected, means callback should have happened already! */ |
1739 | pr = GNUNET_CONTAINER_multihashmap_get(h->peers, &peer->hashPubKey); | ||
1740 | GNUNET_assert(pr != NULL); | ||
1741 | distance[0].type = htonl (GNUNET_TRANSPORT_ATS_QUALITY_NET_DISTANCE); | ||
1742 | distance[0].value = htonl (1); | ||
1743 | distance[1].type = htonl (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR); | ||
1744 | distance[1].value = htonl (0); | ||
1745 | 1737 | ||
1746 | if (NULL != h->connects) | ||
1747 | h->connects (h->cls, | ||
1748 | &pr->peer, | ||
1749 | &distance[0]); | ||
1750 | return NULL; | ||
1751 | } | ||
1752 | 1738 | ||
1753 | cm = GNUNET_malloc (sizeof (struct ControlMessage) + | 1739 | cm = GNUNET_malloc (sizeof (struct ControlMessage) + |
1754 | sizeof (struct ConnectMessage)); | 1740 | sizeof (struct ConnectMessage)); |