{
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
" it's for us! sending to clients...\n");
+ GNUNET_STATISTICS_update (stats, "# unicast received", 1, GNUNET_NO);
send_subscribed_clients (message, (struct GNUNET_MessageHeader *) &msg[1]);
return GNUNET_OK;
}
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
" not for us, retransmitting...\n");
+ GNUNET_STATISTICS_update (stats, "# unicast forwarded", 1, GNUNET_NO);
+
send_message (message, tree_get_first_hop (t->tree, pid), t);
return GNUNET_OK;
}
if (NULL != t->peers &&
GNUNET_CONTAINER_multihashmap_contains (t->peers, &my_full_id.hashPubKey))
{
+ GNUNET_STATISTICS_update (stats, "# multicast received", 1, GNUNET_NO);
send_subscribed_clients (message, &msg[1].header);
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " ttl: %u\n", ntohl (msg->ttl));
GNUNET_log (GNUNET_ERROR_TYPE_WARNING, " TTL is 0, DROPPING!\n");
return GNUNET_OK;
}
+ GNUNET_STATISTICS_update (stats, "# multicast forwarded", 1, GNUNET_NO);
tunnel_send_multicast (t, message, GNUNET_NO);
return GNUNET_OK;
}
if (NULL == t->owner)
{
/* got data packet for ownerless tunnel */
+ GNUNET_STATISTICS_update (stats, "# data on ownerless tunnel",
+ 1, GNUNET_NO);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " no clients!\n");
GNUNET_break_op (0);
return GNUNET_OK;
memcpy (cbuf, message, size);
copy = (struct GNUNET_MESH_ToOrigin *) cbuf;
copy->tid = htonl (t->local_tid);
+ GNUNET_STATISTICS_update (stats, "# to origin received", 1, GNUNET_NO);
GNUNET_SERVER_notification_context_unicast (nc, t->owner->handle,
©->header, GNUNET_YES);
return GNUNET_OK;
}
GNUNET_PEER_resolve (tree_get_predecessor (t->tree), &id);
send_message (message, &id, t);
+ GNUNET_STATISTICS_update (stats, "# to origin forwarded", 1, GNUNET_NO);
return GNUNET_OK;
}
GNUNET_CONTAINER_DLL_remove (clients, clients_tail, c);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " CLIENT FREE at %p\n", c);
GNUNET_free (c);
+ GNUNET_STATISTICS_update (stats, "# clients", -1, GNUNET_NO);
c = next;
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, " done!\n");
c->incoming_tunnels = GNUNET_CONTAINER_multihashmap_create (32);
c->ignore_tunnels = GNUNET_CONTAINER_multihashmap_create (32);
GNUNET_SERVER_notification_context_add (nc, client);
+ GNUNET_STATISTICS_update (stats, "# clients", 1, GNUNET_NO);
GNUNET_SERVER_receive_done (client, GNUNET_OK);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "new client processed\n");
GNUNET_PEER_change_rc (myid, 1);
GNUNET_PEER_change_rc (peer_info->id, 1);
peer_info_add_path (peer_info, path, GNUNET_YES);
+ GNUNET_STATISTICS_update (stats, "# peers", 1, GNUNET_NO);
return;
}
{
DEBUG_CONN (" (self)\n");
}
+ GNUNET_STATISTICS_update (stats, "# peers", -1, GNUNET_NO);
return;
}