- fix coverity
[oweals/gnunet.git] / src / transport / test_transport_api_timeout.c
index d286cfc8f38ea6c9caa7cd6c87d6815da9c85468..89fabdefdc4d3d076e5558e539305710107f7e84 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     Copyright (C) 2009, 2010 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2009, 2010 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
@@ -14,8 +14,8 @@
 
      You should have received a copy of the GNU General Public License
      along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
+     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+     Boston, MA 02110-1301, USA.
 */
 /**
  * @file transport/test_transport_api_timeout.c
@@ -58,7 +58,7 @@ static struct PeerContext *p1;
 
 static struct PeerContext *p2;
 
-static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
+static struct GNUNET_TRANSPORT_TESTING_ConnectRequest * cc;
 
 static struct GNUNET_TRANSPORT_TransmitHandle *th;
 
@@ -120,8 +120,9 @@ end ()
   GNUNET_TRANSPORT_TESTING_done (tth);
 }
 
+
 static void
-end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+end_badly (void *cls)
 {
   die_task = NULL;
 
@@ -181,15 +182,11 @@ notify_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
 
 
 static void
-timer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+timer (void *cls)
 {
   static int percentage;
 
   timer_task = NULL;
-
-  if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
-    return;
-
   percentage += 10;
   time_running =
       GNUNET_TIME_relative_add (time_running,
@@ -211,13 +208,15 @@ timer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   }
 }
 
+
 static void
 testing_connect_cb (struct PeerContext *p1, struct PeerContext *p2, void *cls)
 {
   cc = NULL;
   char *p1_c = GNUNET_strdup (GNUNET_i2s (&p1->id));
 
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peers connected: %s <-> %s\n", p1_c,
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Peers connected: %s <-> %s\n", p1_c,
               GNUNET_i2s (&p2->id));
   GNUNET_free (p1_c);