-bringing copyright tags up to FSF standard
[oweals/gnunet.git] / src / transport / gnunet-service-transport_clients.c
index 642e309e6e8b2ef14d1f3a3971a0cf934f1de7b2..0aef9f97e6b457d79bb6e047e85e4649bfeed1a3 100644 (file)
@@ -1,6 +1,6 @@
 /*
      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
@@ -20,7 +20,7 @@
 
 /**
  * @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"
@@ -549,7 +549,9 @@ client_disconnect_notification (void *cls,
     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)
   {
@@ -1078,7 +1080,10 @@ compose_address_iterate_response_message (const struct GNUNET_PeerIdentity *peer
     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);
@@ -1176,7 +1181,6 @@ struct IterationContext
  * 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
@@ -1185,7 +1189,6 @@ struct IterationContext
  */
 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,
@@ -1196,13 +1199,13 @@ send_validation_information (void *cls,
   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);
@@ -1459,7 +1462,7 @@ plugin_session_info_cb (void *cls,
   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,