#include "gnunet-peerinfo_plugins.h"
/**
- * How long until we time out during peerinfo iterations?
+ * How long until we time out during address lookup?
*/
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 5)
/**
* Handle to current #GNUNET_PEERINFO_add_peer() operation.
*/
-static struct GNUNET_PEERINFO_AddContext *ac;
+static struct GNUNET_MQ_Envelope *ac;
/**
* Hello of this peer (if initialized).
* Continuation called from #GNUNET_PEERINFO_add_peer()
*
* @param cls closure, NULL
- * @param emsg error message, NULL on success
*/
static void
-add_continuation (void *cls,
- const char *emsg)
+add_continuation (void *cls)
{
ac = NULL;
- if (NULL != emsg)
- fprintf (stderr,
- _("Failure adding HELLO: %s\n"),
- emsg);
tt = GNUNET_SCHEDULER_add_now (&state_machine, NULL);
}
{
/* WARNING: this adds the address from URI WITHOUT verification! */
if (GNUNET_OK == ret)
- ac = GNUNET_PEERINFO_add_peer (peerinfo, hello,
+ ac = GNUNET_PEERINFO_add_peer (peerinfo,
+ hello,
&add_continuation,
NULL);
else
if (NULL != ac)
{
- GNUNET_PEERINFO_add_peer_cancel (ac);
+ GNUNET_MQ_send_cancel (ac);
ac = NULL;
}
if (NULL != tt)
pic = GNUNET_PEERINFO_iterate (peerinfo,
include_friend_only,
NULL,
- TIMEOUT,
&print_peer_info, NULL);
}
else if (GNUNET_YES == get_self)
pic = GNUNET_PEERINFO_iterate (peerinfo,
include_friend_only,
&my_peer_identity,
- TIMEOUT,
&print_my_uri, NULL);
get_uri = GNUNET_NO;
}