/*
This file is part of GNUnet.
- (C) 2010-2014 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2010-2014 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
/**
* @file transport/gnunet-service-transport_clients.c
- * @brief plugin management API
+ * @brief communication with clients (core service and monitors)
* @author Christian Grothoff
*/
#include "platform.h"
tc->message_count--;
GNUNET_free (mqe);
}
- GNUNET_CONTAINER_DLL_remove (clients_head, clients_tail, tc);
+ GNUNET_CONTAINER_DLL_remove (clients_head,
+ clients_tail,
+ tc);
GNUNET_SERVER_client_set_user_context (client, NULL);
if (NULL != tc->th)
{
alen = address->address_length;
}
else
- tlen = alen = 0;
+ {
+ tlen = 0;
+ alen = 0;
+ }
size = (sizeof (struct PeerIterateResponseMessage) + alen + tlen);
msg = GNUNET_malloc (size);
msg->header.size = htons (size);
* Output information of validation entries to the given client.
*
* @param cls the `struct IterationContext *`
- * @param peer identity of the neighbour
* @param address the address
* @param last_validation point in time when last validation was performed
* @param valid_until point in time how long address is valid
*/
static void
send_validation_information (void *cls,
- const struct GNUNET_PeerIdentity *peer,
const struct GNUNET_HELLO_Address *address,
struct GNUNET_TIME_Absolute last_validation,
struct GNUNET_TIME_Absolute valid_until,
struct ValidationIterateResponseMessage *msg;
if ( (GNUNET_YES != pc->all) &&
- (0 != memcmp (peer, &pc->id, sizeof (pc->id))) )
+ (0 != memcmp (&address->peer, &pc->id, sizeof (pc->id))) )
return;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Sending information about for validation entry for peer `%s' using address `%s'\n",
- GNUNET_i2s(peer),
+ GNUNET_i2s (&address->peer),
(NULL != address) ? GST_plugins_a2s (address) : "<none>");
- msg = compose_validation_iterate_response_message (peer, address);
+ msg = compose_validation_iterate_response_message (&address->peer, address);
msg->last_validation = GNUNET_TIME_absolute_hton(last_validation);
msg->valid_until = GNUNET_TIME_absolute_hton(valid_until);
msg->next_validation = GNUNET_TIME_absolute_hton(next_validation);
msg->plugin_address_len = htons (alen);
name = (char *) &msg[1];
memcpy (name, info->address->transport_name, slen);
- addr = &name[slen + 1];
+ addr = &name[slen];
memcpy (addr, info->address->address, alen);
if (NULL != sync_client)
GNUNET_SERVER_notification_context_unicast (plugin_nc,