* BUGS:
* - bi-directional nature of TCP is not exploited
* - re-validation is broken (triggered only on successful validation,
- * does not consider expiration times
+ * does not consider expiration times)
*
*
* NOTE:
else
{
GNUNET_STATISTICS_update (stats,
- gettext_noop ("# transmission attempts failed (no validated address)"),
+ gettext_noop ("# transmission attempts failed (no address)"),
1,
GNUNET_NO);
}
return; /* nobody ready */
}
GNUNET_STATISTICS_update (stats,
- gettext_noop ("# message delivery deferred (no validated address)"),
+ gettext_noop ("# message delivery deferred (no address)"),
1,
GNUNET_NO);
if (neighbour->retry_task != GNUNET_SCHEDULER_NO_TASK)
/**
* Create a fresh entry in our neighbour list for the given peer.
- * Will try to transmit our current HELLO to the new neighbour. Also
- * notifies our clients about the new "connection".
+ * Will try to transmit our current HELLO to the new neighbour.
*
* @param peer the peer for which we create the entry
* @return the new neighbour list entry
n->timeout_task = GNUNET_SCHEDULER_add_delayed (sched,
GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT,
&neighbour_timeout_task, n);
+ // FIXME: query PEERINFO for HELLO for this peer &
+ // add addresses!?
transmit_to_peer (NULL, NULL, 0,
HELLO_ADDRESS_EXPIRATION,
(const char *) our_hello, GNUNET_HELLO_size(our_hello),
va,
GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
neighbour = find_neighbour(&id);
+ /* FIXME: can neighbour be NULL here? (why do we still PING?)? If so,
+ should we even do this? */
if (neighbour == NULL)
neighbour = setup_new_neighbour(&id);
peer_address = add_peer_address(neighbour, tname, addr, addrlen);
GNUNET_assert (fal != NULL);
fal->expires = GNUNET_TIME_relative_to_absolute (HELLO_ADDRESS_EXPIRATION);
fal->validated = GNUNET_YES;
+ GNUNET_STATISTICS_update (stats,
+ gettext_noop ("# peer addresses considered valid"),
+ 1,
+ GNUNET_NO);
fal->latency = GNUNET_TIME_absolute_get_duration (ve->send_time);
periodic_validation_context = GNUNET_malloc(sizeof(struct PeriodicValidationContext));
periodic_validation_context->foreign_address = fal;
struct ForeignAddressList *fal;
int try;
+ GNUNET_STATISTICS_update (stats,
+ gettext_noop ("# valid peer addresses returned by peerinfo"),
+ 1,
+ GNUNET_NO);
try = GNUNET_NO;
fal = find_peer_address (n, tname, addr, addrlen);
if (fal == NULL)
expiration.value);
#endif
fal = add_peer_address (n, tname, addr, addrlen);
+ if (fal == NULL)
+ {
+ GNUNET_STATISTICS_update (stats,
+ gettext_noop ("# previously validated addresses lacking transport"),
+ 1,
+ GNUNET_NO);
+ }
try = GNUNET_YES;
}
if (fal == NULL)
return GNUNET_OK;
fal->expires = GNUNET_TIME_absolute_max (expiration,
fal->expires);
- fal->validated = GNUNET_YES;
+ if (fal->validated == GNUNET_NO)
+ {
+ fal->validated = GNUNET_YES;
+ GNUNET_STATISTICS_update (stats,
+ gettext_noop ("# peer addresses considered valid"),
+ 1,
+ GNUNET_NO);
+ }
if (try == GNUNET_YES)
try_transmission_to_peer (n);
return GNUNET_OK;
n);
try_transmission_to_peer (n);
}
+ else
+ {
+ GNUNET_STATISTICS_update (stats,
+ gettext_noop ("# no existing neighbour record while validating HELLO"),
+ 1,
+ GNUNET_NO);
+ }
+ GNUNET_STATISTICS_update (stats,
+ gettext_noop ("# HELLO validations (update case)"),
+ 1,
+ GNUNET_NO);
GNUNET_HELLO_iterate_new_addresses (chvc->hello,
h,
GNUNET_TIME_relative_to_absolute (HELLO_REVALIDATION_START_TIME),
GNUNET_break (0);
return GNUNET_SYSERR;
}
+ GNUNET_STATISTICS_update (stats,
+ gettext_noop ("# HELLOs received for validation"),
+ 1,
+ GNUNET_NO);
/* first, check if load is too high */
if (GNUNET_SCHEDULER_get_load (sched,
GNUNET_SCHEDULER_PRIORITY_BACKGROUND) > MAX_HELLO_LOAD)
GNUNET_STATISTICS_update (stats,
gettext_noop ("# connected addresses"),
-1,
- GNUNET_NO);
+ GNUNET_NO);
+ if (GNUNET_YES == peer_pos->validated)
+ GNUNET_STATISTICS_update (stats,
+ gettext_noop ("# peer addresses considered valid"),
+ -1,
+ GNUNET_NO);
GNUNET_free(peer_pos);
}
GNUNET_free (rpos);