gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r16293 - gnunet/src/core


From: gnunet
Subject: [GNUnet-SVN] r16293 - gnunet/src/core
Date: Mon, 1 Aug 2011 22:41:37 +0200

Author: grothoff
Date: 2011-08-01 22:41:37 +0200 (Mon, 01 Aug 2011)
New Revision: 16293

Modified:
   gnunet/src/core/test_core_api_preferences.c
   gnunet/src/core/test_core_api_reliability.c
   gnunet/src/core/test_core_quota_compliance.c
Log:
LRN: Keep passing HELLO messages to transport

in core preferences, reliability and quota compliance tests,
because first HELLO might be empty



Modified: gnunet/src/core/test_core_api_preferences.c
===================================================================
--- gnunet/src/core/test_core_api_preferences.c 2011-08-01 20:40:59 UTC (rev 
16292)
+++ gnunet/src/core/test_core_api_preferences.c 2011-08-01 20:41:37 UTC (rev 
16293)
@@ -75,6 +75,7 @@
 static unsigned int total_reserve = 5;
 
 
+static void process_hello (void *cls, const struct GNUNET_MessageHeader 
*message);
 
 static void
 terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
@@ -84,6 +85,8 @@
 #endif
   GNUNET_assert (ok == 6);
   GNUNET_assert (NULL == irc);
+  GNUNET_TRANSPORT_get_hello_cancel (p1.th, &process_hello, &p1);
+  GNUNET_TRANSPORT_get_hello_cancel (p2.th, &process_hello, &p2);
   GNUNET_CORE_disconnect (p1.ch);
   GNUNET_CORE_disconnect (p2.ch);
   GNUNET_TRANSPORT_disconnect (p1.th);
@@ -115,6 +118,8 @@
       GNUNET_SCHEDULER_cancel (ask_task);
       ask_task = GNUNET_SCHEDULER_NO_TASK;
     }
+  GNUNET_TRANSPORT_get_hello_cancel (p1.th, &process_hello, &p1);
+  GNUNET_TRANSPORT_get_hello_cancel (p2.th, &process_hello, &p2);
   GNUNET_CORE_disconnect (p1.ch);
   GNUNET_CORE_disconnect (p2.ch);
   GNUNET_TRANSPORT_disconnect (p1.th);
@@ -418,7 +423,6 @@
 {
   struct PeerContext *p = cls;
 
-  GNUNET_TRANSPORT_get_hello_cancel (p->th, &process_hello, p);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Received (my) `%s' from transport service\n",
               "HELLO");

Modified: gnunet/src/core/test_core_api_reliability.c
===================================================================
--- gnunet/src/core/test_core_api_reliability.c 2011-08-01 20:40:59 UTC (rev 
16292)
+++ gnunet/src/core/test_core_api_reliability.c 2011-08-01 20:41:37 UTC (rev 
16293)
@@ -112,12 +112,15 @@
   return sizeof (struct TestMessage) + (ret % 60000);
 }
 
+static void process_hello (void *cls, const struct GNUNET_MessageHeader 
*message);
 
 static void
 terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   unsigned long long delta;
 
+  GNUNET_TRANSPORT_get_hello_cancel (p1.th, &process_hello, &p1);
+  GNUNET_TRANSPORT_get_hello_cancel (p2.th, &process_hello, &p2);
   GNUNET_CORE_disconnect (p1.ch);
   p1.ch = NULL;
   GNUNET_CORE_disconnect (p2.ch);
@@ -151,11 +154,13 @@
     }
   if (p1.th != NULL)
     {
+      GNUNET_TRANSPORT_get_hello_cancel (p1.th, &process_hello, &p1);
       GNUNET_TRANSPORT_disconnect (p1.th);
       p1.th = NULL;
     }
   if (p2.th != NULL)
     {
+      GNUNET_TRANSPORT_get_hello_cancel (p2.th, &process_hello, &p2);
       GNUNET_TRANSPORT_disconnect (p2.th);
       p2.th = NULL;
     }
@@ -437,7 +442,6 @@
 {
   struct PeerContext *p = cls;
 
-  GNUNET_TRANSPORT_get_hello_cancel (p->th, &process_hello, p);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Received (my) `%s' from transport service\n",
               "HELLO");

Modified: gnunet/src/core/test_core_quota_compliance.c
===================================================================
--- gnunet/src/core/test_core_quota_compliance.c        2011-08-01 20:40:59 UTC 
(rev 16292)
+++ gnunet/src/core/test_core_quota_compliance.c        2011-08-01 20:41:37 UTC 
(rev 16293)
@@ -114,11 +114,15 @@
   uint32_t num;
 };
 
+static void process_hello (void *cls, const struct GNUNET_MessageHeader 
*message);
+
 static void
 terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   struct GNUNET_CORE_Handle *ch;
 
+  GNUNET_TRANSPORT_get_hello_cancel (p2.th, &process_hello, &p2);
+  GNUNET_TRANSPORT_get_hello_cancel (p1.th, &process_hello, &p1);
   ch = p1.ch;
   p1.ch = NULL;
   GNUNET_CORE_disconnect (ch);
@@ -142,6 +146,9 @@
   if (measure_task != GNUNET_SCHEDULER_NO_TASK)
          GNUNET_SCHEDULER_cancel(measure_task);
 
+  GNUNET_TRANSPORT_get_hello_cancel (p1.th, &process_hello, &p1);
+  GNUNET_TRANSPORT_get_hello_cancel (p2.th, &process_hello, &p2);
+
   GNUNET_CORE_disconnect (p1.ch);
   p1.ch = NULL;
   GNUNET_CORE_disconnect (p2.ch);
@@ -572,7 +579,6 @@
 {
   struct PeerContext *p = cls;
 
-  GNUNET_TRANSPORT_get_hello_cancel (p->th, &process_hello, p);
 
 #if DEBUG_TRANSMISSION
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,




reply via email to

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