&cnm->peer,
sizeof (struct GNUNET_PeerIdentity)))
{
- /* disconnect from self!? */
+ /* connect to self!? */
GNUNET_break (0);
return;
}
* @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,
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));