naming
[oweals/gnunet.git] / src / transport / test_transport_api.c
index 49e160ddba2ba21b7cb2bf76450d296847927066..70658d40b473e1e8cc29f1c6fb5cf9df93753e54 100644 (file)
@@ -38,7 +38,6 @@
 #include "transport-testing.h"
 
 #define VERBOSE GNUNET_EXTRA_LOGGING
-
 #define VERBOSE_ARM GNUNET_EXTRA_LOGGING
 
 #define START_ARM GNUNET_YES
@@ -75,7 +74,7 @@ static GNUNET_TRANSPORT_TESTING_ConnectRequest cc;
 
 struct GNUNET_TRANSPORT_TransmitHandle *th;
 
-struct TransportTestingHandle * tth;
+struct GNUNET_TRANSPORT_TESTING_handle * tth;
 
 char *cfg_file_p1;
 
@@ -92,55 +91,7 @@ static void
 end ()
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stopping peers\n");
-#if 0
-static void
-get_hello_p2 (void *cb_cls, const struct GNUNET_MessageHeader *message);
-
-static void
-get_hello_p1 (void *cb_cls, const struct GNUNET_MessageHeader *message);
-
-static void
-notify_connect_internal (void *cls, const struct GNUNET_PeerIdentity *peer,
-                         const struct GNUNET_TRANSPORT_ATS_Information *ats,
-                         uint32_t ats_count)
-{
-  struct ConnectingContext *cc = cls;
-
-  GNUNET_assert (cc != NULL);
 
-  if (0 ==
-      memcmp (&(*peer).hashPubKey, &cc->p1->id.hashPubKey,
-              sizeof (GNUNET_HashCode)))
-  {
-    if (cc->p1_c == GNUNET_NO)
-      cc->p1_c = GNUNET_YES;
-  }
-  if (0 ==
-      memcmp (&(*peer).hashPubKey, &cc->p2->id.hashPubKey,
-              sizeof (GNUNET_HashCode)))
-  {
-    if (cc->p2_c == GNUNET_NO)
-      cc->p2_c = GNUNET_YES;
-  }
-
-  if ((cc->p2_c == GNUNET_YES) && (cc->p2_c == GNUNET_YES))
-  {
-    /* clean up */
-    if (cc->tct != GNUNET_SCHEDULER_NO_TASK)
-      GNUNET_SCHEDULER_cancel (cc->tct);
-
-    cc->tct = GNUNET_SCHEDULER_NO_TASK;
-
-    GNUNET_TRANSPORT_disconnect (cc->th_p1);
-    GNUNET_TRANSPORT_disconnect (cc->th_p2);
-
-    if (cc->cb != NULL)
-      cc->cb (cc->p1, cc->p2, cc->cb_cls);
-
-    GNUNET_free (cc);
-  }
-}
-#endif
   if (send_task != GNUNET_SCHEDULER_NO_TASK)
     GNUNET_SCHEDULER_cancel (send_task);
 
@@ -170,6 +121,7 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   {
     GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Fail! Could not connect peers\n"));
     GNUNET_TRANSPORT_TESTING_connect_peers_cancel (tth, cc);
+    cc = NULL;
   }
 
   if (th != NULL)
@@ -181,8 +133,6 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
   if (p2 != NULL)
     GNUNET_TRANSPORT_TESTING_stop_peer (tth, p2);
 
-  GNUNET_TRANSPORT_TESTING_done (tth);
-
   ok = GNUNET_SYSERR;
 }