/*
This file is part of GNUnet.
- Copyright (C) 2013 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2013 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
static void
client_destroy (struct CadetClient *c)
{
- LOG (GNUNET_ERROR_TYPE_INFO, " client destroy: %p/%u\n", c, c->id);
+ LOG (GNUNET_ERROR_TYPE_DEBUG, " client destroy: %p/%u\n", c, c->id);
GNUNET_SERVER_client_drop (c->handle);
c->shutting_down = GNUNET_YES;
GNUNET_CONTAINER_DLL_insert (clients_head, clients_tail, c);
GNUNET_STATISTICS_update (stats, "# clients", +1, GNUNET_NO);
- LOG (GNUNET_ERROR_TYPE_INFO, " client created: %p/%u\n", c, c->id);
+ LOG (GNUNET_ERROR_TYPE_DEBUG, " client created: %p/%u\n", c, c->id);
return c;
}
static void
handle_client_connect (void *cls, struct GNUNET_SERVER_Client *client)
{
- LOG (GNUNET_ERROR_TYPE_INFO, "Client connected: %p\n", client);
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "Client connected: %p\n", client);
if (NULL == client)
return;
{
struct CadetClient *c;
- LOG (GNUNET_ERROR_TYPE_INFO, "Client disconnected: %p\n", client);
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "Client disconnected: %p\n", client);
c = GML_client_get (client);
if (NULL != c)
uint32_t *p;
unsigned int i;
- LOG (GNUNET_ERROR_TYPE_DEBUG, "\n");
- LOG (GNUNET_ERROR_TYPE_INFO, "new client registering %p\n", client);
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "new client registering %p\n", client);
/* Check data sanity */
size = ntohs (message->size);
return;
}
- LOG (GNUNET_ERROR_TYPE_INFO, " client %u has %u ports\n", c-> id, size);
+ LOG (GNUNET_ERROR_TYPE_DEBUG, " client %u has %u ports\n", c-> id, size);
if (size > 0)
{
uint32_t u32;
for (i = 0; i < size; i++)
{
u32 = ntohl (p[i]);
- LOG (GNUNET_ERROR_TYPE_INFO, " port: %u\n", u32);
+ LOG (GNUNET_ERROR_TYPE_DEBUG, " port: %u\n", u32);
/* store in client's hashmap */
GNUNET_CONTAINER_multihashmap32_put (c->ports, u32, c,
GNUNET_SERVER_notification_context_unicast (nc, c->handle,
&resp->header, GNUNET_NO);
- LOG (GNUNET_ERROR_TYPE_INFO, "Show peer request from client %u completed.\n");
+ LOG (GNUNET_ERROR_TYPE_INFO, "Show peer from client %u completed.\n", c->id);
GNUNET_SERVER_receive_done (client, GNUNET_OK);
}
iter_channel (void *cls, struct CadetChannel *ch)
{
struct GNUNET_CADET_LocalInfoTunnel *msg = cls;
- struct GNUNET_HashCode *h = (struct GNUNET_HashCode *) &msg[1];
+ struct GNUNET_CADET_Hash *h = (struct GNUNET_CADET_Hash *) &msg[1];
CADET_ChannelNumber *chn = (CADET_ChannelNumber *) &h[msg->connections];
chn[msg->channels] = htonl (GCCH_get_id (ch));
resp = GNUNET_malloc (size);
resp->header.type = htons (GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_TUNNEL);
resp->header.size = htons (size);
+ resp->destination = msg->peer;
+ /* Do not interleave with iterators, iter_channel needs conn in HBO */
GCT_iterate_connections (t, &iter_connection, resp);
GCT_iterate_channels (t, &iter_channel, resp);
- /* Do not interleave with iterators, iter_channel needs conn in HBO */
- resp->destination = msg->peer;
resp->connections = htonl (resp->connections);
resp->channels = htonl (resp->channels);
+ /* Do not interleave end */
resp->cstate = htons (GCT_get_cstate (t));
resp->estate = htons (GCT_get_estate (t));
GNUNET_SERVER_notification_context_unicast (nc, c->handle,
{
struct CadetClient *c;
+ LOG (GNUNET_ERROR_TYPE_DEBUG, "Shutting down local\n");
+
for (c = clients_head; NULL != clients_head; c = clients_head)
client_destroy (c);