* @param emsg error message, NULL on success
*/
static void
-result_callback (void *cls, int success, const char *emsg)
+result_callback (void *cls, enum GNUNET_NAT_FailureCode result)
{
struct TestContext *tc = cls;
- display_test_result (tc, success);
+ display_test_result (tc, result);
}
/**
static void
-process_validation_string (void *cls, const char *address)
+process_validation_string (void *cls, const char *address, int res)
{
struct ValidationResolutionContext *vc = cls;
char *s_valid;
if (address != NULL )
{
+ if (GNUNET_SYSERR == res)
+ {
+ FPRINTF (stderr, "Failed to convert address for peer `%s' plugin `%s' length %lu to string \n",
+ GNUNET_i2s (&vc->id),
+ vc->addrcp->transport_name,
+ vc->addrcp->address_length);
+ }
if (GNUNET_TIME_UNIT_ZERO_ABS.abs_value_us == vc->valid_until.abs_value_us)
s_valid = GNUNET_strdup("never");
else
FPRINTF (stdout,
_("Peer `%s' %s %s\n\t%s%s\n\t%s%s\n\t%s%s\n"),
- GNUNET_i2s (&vc->id), address,
+ GNUNET_i2s (&vc->id),
+ (GNUNET_OK == res) ? address : "<invalid address>",
(monitor_validation) ? GNUNET_TRANSPORT_vs2s (vc->state) : "",
"Valid until : ", s_valid,
"Last validation: ",s_last,
else
{
/* done */
+
GNUNET_assert(address_resolutions > 0);
address_resolutions--;
- if (GNUNET_NO == vc->printed)
+ if ((GNUNET_SYSERR == res) && (GNUNET_NO == vc->printed))
{
if (numeric == GNUNET_NO)
{
static void
-process_peer_string (void *cls, const char *address)
+process_peer_string (void *cls, const char *address, int res)
{
struct PeerResolutionContext *rc = cls;
- if (address != NULL )
+ if (GNUNET_SYSERR == res)
+ {
+ FPRINTF (stderr, "Failed to convert address for peer `%s' plugin `%s' length %lu to string \n",
+ GNUNET_i2s (&rc->id),
+ rc->addrcp->transport_name,
+ rc->addrcp->address_length);
+ print_info (&rc->id, rc->transport, NULL, rc->state, rc->state_timeout);
+ rc->printed = GNUNET_YES;
+ return;
+ }
+
+ if ((GNUNET_OK == res) && (address != NULL))
{
print_info (&rc->id, rc->transport, address, rc->state, rc->state_timeout);
rc->printed = GNUNET_YES;
+ return; /* Wait for done call */
}
- else
+
+ if (NULL == address)
{
/* done */
GNUNET_assert(address_resolutions > 0);
}
else
{
- print_info (&rc->id, rc->transport, "<unable to resolve address>",
+ print_info (&rc->id, rc->transport, NULL,
rc->state, rc->state_timeout);
}
}