gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r31856 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r31856 - gnunet/src/transport
Date: Thu, 9 Jan 2014 11:42:49 +0100

Author: wachs
Date: 2014-01-09 11:42:49 +0100 (Thu, 09 Jan 2014)
New Revision: 31856

Modified:
   gnunet/src/transport/test_transport_api_monitoring.c
Log:
fixed return value


Modified: gnunet/src/transport/test_transport_api_monitoring.c
===================================================================
--- gnunet/src/transport/test_transport_api_monitoring.c        2014-01-09 
10:34:32 UTC (rev 31855)
+++ gnunet/src/transport/test_transport_api_monitoring.c        2014-01-09 
10:42:49 UTC (rev 31856)
@@ -77,9 +77,14 @@
 static char *cfg_file_p2;
 
 static struct GNUNET_TRANSPORT_PeerMonitoringContext *pmc_p1;
+
 static struct GNUNET_TRANSPORT_PeerMonitoringContext *pmc_p2;
 
+static int p1_c = GNUNET_NO;
 
+static int p2_c = GNUNET_NO;
+
+
 static void
 end ()
 {
@@ -111,6 +116,8 @@
   p1 = NULL;
   GNUNET_TRANSPORT_TESTING_stop_peer (tth, p2);
   p2 = NULL;
+
+  ok = 0;
 }
 
 static void
@@ -153,6 +160,17 @@
 
   th = NULL;
 
+  if (NULL != pmc_p1)
+  {
+    GNUNET_TRANSPORT_monitor_peers_cancel (pmc_p1);
+    pmc_p1 = NULL;
+  }
+  if (NULL != pmc_p2)
+  {
+    GNUNET_TRANSPORT_monitor_peers_cancel (pmc_p2);
+    pmc_p2 = NULL;
+  }
+
   if (p1 != NULL)
     GNUNET_TRANSPORT_TESTING_stop_peer (tth, p1);
   else
@@ -330,13 +348,15 @@
                                                NULL);
 
 }
-static int p1_c = GNUNET_NO;
-static int p2_c = GNUNET_NO;
 
 static void done ()
 {
   if ((GNUNET_YES == p1_c) && (GNUNET_YES == p2_c))
-   end();
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Both peers state to be connected\n");
+    ok = 0;
+    end();
+  }
 }
 
 static void monitor1_cb (void *cls,
@@ -442,6 +462,8 @@
 {
   int ret;
 
+  ok = 1;
+
   GNUNET_TRANSPORT_TESTING_get_test_name (argv[0], &test_name);
   GNUNET_TRANSPORT_TESTING_get_test_source_name (__FILE__, &test_source);
   GNUNET_TRANSPORT_TESTING_get_test_plugin_name (argv[0], test_source,
@@ -466,7 +488,10 @@
 
   GNUNET_TRANSPORT_TESTING_done (tth);
 
-  return ret;
+  if (0 != ret)
+    return ret;
+  else
+    return ok;
 }
 
 /* end of test_transport_api.c */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]