if (n->keep_alive_task != GNUNET_SCHEDULER_NO_TASK)
GNUNET_SCHEDULER_cancel (sched, n->keep_alive_task);
if (n->status == PEER_STATE_KEY_CONFIRMED)
- GNUNET_STATISTICS_update (stats, gettext_noop ("# peers connected"), -1, GNUNET_NO);
+ GNUNET_STATISTICS_update (stats, gettext_noop ("# established sessions"), -1, GNUNET_NO);
GNUNET_free_non_null (n->public_key);
GNUNET_free_non_null (n->pending_ping);
GNUNET_free_non_null (n->pending_pong);
char *cbuf;
n->th = NULL;
- GNUNET_assert (NULL != (m = n->encrypted_head));
+ m = n->encrypted_head;
+ if (m == NULL)
+ return 0;
GNUNET_CONTAINER_DLL_remove (n->encrypted_head,
n->encrypted_tail,
m);
#endif
return; /* already in progress */
}
-
+ if (! n->is_connected)
+ {
+ if (NULL == n->th)
+ {
+ GNUNET_STATISTICS_update (stats,
+ gettext_noop ("# Asking transport to connect (for SETKEY)"),
+ 1,
+ GNUNET_NO);
+ n->th = GNUNET_TRANSPORT_notify_transmit_ready (transport,
+ &n->peer,
+ sizeof (struct SetKeyMessage) + sizeof (struct PingMessage),
+ GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT,
+ ¬ify_encrypted_transmit_ready,
+ n);
+ }
+ return;
+ }
#if DEBUG_CORE
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Asked to perform key exchange with `%4s'.\n",
n->last_activity = now;
if (!up)
{
- GNUNET_STATISTICS_update (stats, gettext_noop ("# peers connected"), 1, GNUNET_NO);
+ GNUNET_STATISTICS_update (stats, gettext_noop ("# established sessions"), 1, GNUNET_NO);
n->time_established = now;
}
if (n->keep_alive_task != GNUNET_SCHEDULER_NO_TASK)
{
n = create_neighbour (peer);
}
+ GNUNET_STATISTICS_update (stats,
+ gettext_noop ("# peers connected"),
+ 1,
+ GNUNET_NO);
n->is_connected = GNUNET_YES;
n->last_latency = latency;
n->last_distance = distance;
cnm.peer = *peer;
send_to_all_clients (&cnm.header, GNUNET_YES, GNUNET_CORE_OPTION_SEND_DISCONNECT);
n->is_connected = GNUNET_NO;
+ GNUNET_STATISTICS_update (stats,
+ gettext_noop ("# peers connected"),
+ -1,
+ GNUNET_NO);
}
/**
* Check if we could queue a message of the given size for
- * transmission. The transport service will take both its
- * internal buffers and bandwidth limits imposed by the
- * other peer into consideration when answering this query.
+ * transmission. The transport service will take both its internal
+ * buffers and bandwidth limits imposed by the other peer into
+ * consideration when answering this query.
*
* @param handle connection to transport service
* @param target who should receive the message
{
struct MessageQueue *mq = cls;
struct NeighbourList *n;
-
+
+ GNUNET_STATISTICS_update (stats,
+ gettext_noop ("# bytes pending with plugins"),
+ -mq->message_buf_size,
+ GNUNET_NO);
if (result == GNUNET_OK)
{
GNUNET_STATISTICS_update (stats,
-mq->message_buf_size,
GNUNET_NO);
GNUNET_STATISTICS_update (stats,
- gettext_noop ("# bytes transmitted to other peers"),
+ gettext_noop ("# bytes pending with plugins"),
mq->message_buf_size,
GNUNET_NO);
rl->plugin->api->send (rl->plugin->api->cls,
else
{
GNUNET_STATISTICS_update (stats,
- gettext_noop ("# no existing neighbour record while validating HELLO"),
+ gettext_noop ("# no existing neighbour record (validating HELLO)"),
1,
GNUNET_NO);
}