Check that you are not present in trail twice
[oweals/gnunet.git] / src / transport / gnunet-service-transport_clients.c
index 29879c884539d5669b19f194b6ff993d0bff018e..af15023df15b240a9358598c3b988babbb6889dc 100644 (file)
@@ -777,7 +777,7 @@ try_connect_if_allowed (void *cls,
     return;                     /* not allowed */
   }
 
-  GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               _("Blacklist allows connection attempt to peer `%s'\n"),
               GNUNET_i2s (peer));
 
@@ -902,6 +902,7 @@ transmit_address_to_client (void *cls,
       GNUNET_CONTAINER_DLL_remove (a2s_head,
                                    a2s_tail,
                                    actx);
+      GNUNET_free (atsm);
       GNUNET_free (actx);
       return;
     }
@@ -987,9 +988,6 @@ clients_handle_address_to_string (void *cls,
   papi = GST_plugins_printer_find (plugin_name);
   if (NULL == papi)
   {
-    fprintf (stderr,
-             "DEAD: %s\n",
-             plugin_name);
     atsm.header.size = ntohs (sizeof (struct AddressToStringResultMessage));
     atsm.header.type = ntohs (GNUNET_MESSAGE_TYPE_TRANSPORT_ADDRESS_TO_STRING_REPLY);
     atsm.res = htonl (GNUNET_SYSERR);
@@ -1118,10 +1116,11 @@ struct IterationContext
   int all;
 };
 
+
 /**
  * Output information of validation entries to the given client.
  *
- * @param cls the 'struct IterationContext'
+ * @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
@@ -1131,12 +1130,12 @@ 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,
-    struct GNUNET_TIME_Absolute next_validation,
-    enum GNUNET_TRANSPORT_ValidationState state)
+                             const struct GNUNET_PeerIdentity *peer,
+                             const struct GNUNET_HELLO_Address *address,
+                             struct GNUNET_TIME_Absolute last_validation,
+                             struct GNUNET_TIME_Absolute valid_until,
+                             struct GNUNET_TIME_Absolute next_validation,
+                             enum GNUNET_TRANSPORT_ValidationState state)
 {
   struct IterationContext *pc = cls;
   struct ValidationIterateResponseMessage *msg;
@@ -1161,7 +1160,7 @@ send_validation_information (void *cls,
 /**
  * Output information of neighbours to the given client.
  *
- * @param cls the 'struct PeerIterationContext'
+ * @param cls the `struct PeerIterationContext *`
  * @param peer identity of the neighbour
  * @param address the address
  * @param state current state this peer is in
@@ -1171,12 +1170,12 @@ send_validation_information (void *cls,
  */
 static void
 send_peer_information (void *cls,
-    const struct GNUNET_PeerIdentity *peer,
-    const struct GNUNET_HELLO_Address *address,
-    enum GNUNET_TRANSPORT_PeerState state,
-    struct GNUNET_TIME_Absolute state_timeout,
-    struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
-    struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
+                       const struct GNUNET_PeerIdentity *peer,
+                       const struct GNUNET_HELLO_Address *address,
+                       enum GNUNET_TRANSPORT_PeerState state,
+                       struct GNUNET_TIME_Absolute state_timeout,
+                       struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
+                       struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
 {
   struct IterationContext *pc = cls;
   struct PeerIterateResponseMessage *msg;
@@ -1501,21 +1500,20 @@ GST_clients_broadcast_peer_notification (const struct GNUNET_PeerIdentity *peer,
  * @param state state of validation notification
  */
 void
-GST_clients_broadcast_validation_notification (
-    const struct GNUNET_PeerIdentity *peer,
-    const struct GNUNET_HELLO_Address *address,
-    struct GNUNET_TIME_Absolute last_validation,
-    struct GNUNET_TIME_Absolute valid_until,
-    struct GNUNET_TIME_Absolute next_validation,
-    enum GNUNET_TRANSPORT_ValidationState state)
+GST_clients_broadcast_validation_notification (const struct GNUNET_PeerIdentity *peer,
+                                               const struct GNUNET_HELLO_Address *address,
+                                               struct GNUNET_TIME_Absolute last_validation,
+                                               struct GNUNET_TIME_Absolute valid_until,
+                                               struct GNUNET_TIME_Absolute next_validation,
+                                               enum GNUNET_TRANSPORT_ValidationState state)
 {
   struct ValidationIterateResponseMessage *msg;
   struct MonitoringClient *mc;
   static struct GNUNET_PeerIdentity all_zeros;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-      "Sending information about for validation entry for peer `%s' using address `%s'\n",
-      GNUNET_i2s(peer), (address != NULL) ? GST_plugins_a2s (address) : "<none>");
+              "Sending information about for validation entry for peer `%s' using address `%s'\n",
+              GNUNET_i2s(peer), (address != NULL) ? GST_plugins_a2s (address) : "<none>");
 
   msg = compose_validation_iterate_response_message (peer, address);
   msg->last_validation = GNUNET_TIME_absolute_hton(last_validation);