allow empty/NULL context message
[oweals/gnunet.git] / src / transport / gnunet-service-transport_validation.c
index 9b69b5ddd62fda73b348ad784273e4274b2ec6c8..6ea5394bf7c4afdad9daaf00b9451502f7b92140 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     Copyright (C) 2010-2015 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2010-2015 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
@@ -463,11 +463,9 @@ cleanup_validation_entry (void *cls,
  * longer valid and then possibly triggers its removal.
  *
  * @param cls the `struct ValidationEntry`
- * @param tc scheduler context (unused)
  */
 static void
-timeout_hello_validation (void *cls,
-                          const struct GNUNET_SCHEDULER_TaskContext *tc)
+timeout_hello_validation (void *cls)
 {
   struct ValidationEntry *ve = cls;
   struct GNUNET_TIME_Absolute max;
@@ -652,11 +650,9 @@ transmit_ping_if_allowed (void *cls,
  * Do address validation again to keep address valid.
  *
  * @param cls the `struct ValidationEntry`
- * @param tc scheduler context (unused)
  */
 static void
-revalidate_address (void *cls,
-                    const struct GNUNET_SCHEDULER_TaskContext *tc)
+revalidate_address (void *cls)
 {
   struct ValidationEntry *ve = cls;
   struct GNUNET_TIME_Relative canonical_delay;
@@ -877,7 +873,6 @@ add_valid_address (void *cls,
   validation_entry_changed (ve,
                             GNUNET_TRANSPORT_VS_UPDATE);
   memset (&prop, 0, sizeof (prop));
-  GNUNET_break (GNUNET_ATS_NET_UNSPECIFIED != ve->network);
   prop.scope = ve->network;
   prop.delay = GNUNET_TIME_relative_divide (ve->latency, 2);
   if (GNUNET_YES != ve->known_to_ats)
@@ -1064,7 +1059,7 @@ GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender,
       memcmp (&GST_my_identity,
               sender,
               sizeof (struct GNUNET_PeerIdentity)))
-    return; /* our own, ignore! */
+    return GNUNET_OK; /* our own, ignore! */
   if (ntohs (hdr->size) < sizeof (struct TransportPingMessage))
   {
     GNUNET_break_op (0);
@@ -1397,7 +1392,7 @@ GST_validation_handle_pong (const struct GNUNET_PeerIdentity *sender,
       memcmp (&GST_my_identity,
               sender,
               sizeof (struct GNUNET_PeerIdentity)))
-    return; /* our own, ignore! */
+    return GNUNET_OK; /* our own, ignore! */
 
   if (ntohs (hdr->size) < sizeof (struct TransportPongMessage))
   {