X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Fcore%2Fcore_api.c;h=e9a38271bf317cce14072f629e842e521ca4fa6d;hb=9706e822ff61a85bf2353d2c233eb766ffc13323;hp=f4a19790949fa630778fd4abd1e2d0dbdfa835b4;hpb=3294e6c66210cdcca65524593ce09bbf4db14c7f;p=oweals%2Fgnunet.git diff --git a/src/core/core_api.c b/src/core/core_api.c index f4a197909..e9a38271b 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c @@ -921,7 +921,7 @@ main_notify_handler (void *cls, &cnm->peer, sizeof (struct GNUNET_PeerIdentity))) { - /* disconnect from self!? */ + /* connect to self!? */ GNUNET_break (0); return; } @@ -1716,7 +1716,9 @@ peer_request_connect_cont (void *cls, * @param peer who should we connect to * @param cont function to call once the request has been completed (or timed out) * @param cont_cls closure for cont - * @return NULL on error (cont will not be called), otherwise handle for cancellation + * + * @return NULL on error or already connected, + * otherwise handle for cancellation */ struct GNUNET_CORE_PeerRequestHandle * GNUNET_CORE_peer_request_connect (struct GNUNET_CORE_Handle *h, @@ -1731,7 +1733,8 @@ GNUNET_CORE_peer_request_connect (struct GNUNET_CORE_Handle *h, if (NULL != GNUNET_CONTAINER_multihashmap_get (h->peers, &peer->hashPubKey)) - GNUNET_log_from (GNUNET_ERROR_TYPE_WARNING, "core_api", "Received CONNECT requests for already connected peer!\n"); + return NULL; /* Already connected, means callback should have happened already! */ + cm = GNUNET_malloc (sizeof (struct ControlMessage) + sizeof (struct ConnectMessage));