gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r15693 - gnunet/src/transport
Date: Fri, 17 Jun 2011 13:53:17 +0200

Author: wachs
Date: 2011-06-17 13:53:17 +0200 (Fri, 17 Jun 2011)
New Revision: 15693

Modified:
   gnunet/src/transport/test_transport_api.c
   gnunet/src/transport/test_transport_api_reliability.c
   gnunet/src/transport/test_transport_api_unreliability.c
Log:


Modified: gnunet/src/transport/test_transport_api.c
===================================================================
--- gnunet/src/transport/test_transport_api.c   2011-06-17 10:54:27 UTC (rev 
15692)
+++ gnunet/src/transport/test_transport_api.c   2011-06-17 11:53:17 UTC (rev 
15693)
@@ -89,6 +89,8 @@
 static char * key_file_p2;
 static char * cert_file_p2;
 
+struct GNUNET_TRANSPORT_TransmitHandle * th;
+
 #if VERBOSE
 #define OKPP do { ok++; fprintf (stderr, "Now at stage %u at %s:%u\n", ok, 
__FILE__, __LINE__); } while (0)
 #else
@@ -103,6 +105,10 @@
   GNUNET_SCHEDULER_cancel (die_task);
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "Disconnecting from transports!\n");
+  if (th != NULL)
+    GNUNET_TRANSPORT_notify_transmit_ready_cancel(th);
+  th = NULL;
+
   GNUNET_TRANSPORT_disconnect (p1.th);
   GNUNET_TRANSPORT_disconnect (p2.th);
   die_task = GNUNET_SCHEDULER_NO_TASK;
@@ -130,6 +136,11 @@
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from transports!\n");
   GNUNET_break (0);
+
+  if (th != NULL)
+    GNUNET_TRANSPORT_notify_transmit_ready_cancel(th);
+  th = NULL;
+
   GNUNET_TRANSPORT_disconnect (p1.th);
   GNUNET_TRANSPORT_disconnect (p2.th);
   if (GNUNET_SCHEDULER_NO_TASK != tct)
@@ -167,6 +178,8 @@
   struct PeerContext *p = cls;
   struct GNUNET_MessageHeader *hdr;
 
+  th = NULL;
+
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Transmitting message with %u bytes to peer %s\n", 
              sizeof (struct GNUNET_MessageHeader),
@@ -244,7 +257,7 @@
       GNUNET_TRANSPORT_get_hello_cancel (p1.th, &exchange_hello, &p1);
       die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT_TRANSMIT,
                                               &end_badly, NULL);
-      GNUNET_TRANSPORT_notify_transmit_ready (p1.th,
+      th = GNUNET_TRANSPORT_notify_transmit_ready (p1.th,
                                              &p2.id,
                                              256, 0, TIMEOUT, &notify_ready,
                                              &p1);

Modified: gnunet/src/transport/test_transport_api_reliability.c
===================================================================
--- gnunet/src/transport/test_transport_api_reliability.c       2011-06-17 
10:54:27 UTC (rev 15692)
+++ gnunet/src/transport/test_transport_api_reliability.c       2011-06-17 
11:53:17 UTC (rev 15693)
@@ -88,6 +88,8 @@
 
 static GNUNET_SCHEDULER_TaskIdentifier tct;
 
+struct GNUNET_TRANSPORT_TransmitHandle * th_p2;
+
 static char * key_file_p1;
 static char * cert_file_p1;
 
@@ -117,6 +119,11 @@
 #if VERBOSE
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from transports!\n");
 #endif
+
+  if (th_p2 != NULL)
+    GNUNET_TRANSPORT_notify_transmit_ready_cancel(th_p2);
+  th_p2 = NULL;
+
   GNUNET_TRANSPORT_disconnect (p1.th);
   GNUNET_TRANSPORT_disconnect (p2.th);
 #if VERBOSE
@@ -160,6 +167,10 @@
              msg_scheduled, 
              msg_recv, 
              msg_recv_expected);
+  if (th_p2 != NULL)
+    GNUNET_TRANSPORT_notify_transmit_ready_cancel(th_p2);
+  th_p2 = NULL;
+
   GNUNET_break (0);
   GNUNET_TRANSPORT_disconnect (p1.th);
   GNUNET_TRANSPORT_disconnect (p2.th);
@@ -281,6 +292,7 @@
       ok = 42;
       return 0;
     }
+  th_p2 = NULL;
   ret = 0;
   s = get_size (n);
   GNUNET_assert (size >= s);
@@ -313,7 +325,7 @@
   while (size - ret >= s);
   if (n < TOTAL_MSGS)
   {
-    GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
+    th_p2 = GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
                                            &p1.id,
                                            s, 0, TIMEOUT,
                                            &notify_ready,
@@ -415,7 +427,7 @@
       GNUNET_TRANSPORT_get_hello_cancel (p1.th, &exchange_hello, &p1);
       die_task = GNUNET_SCHEDULER_add_delayed (TIMEOUT,
                                               &end_badly, NULL);
-      GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
+      th_p2 = GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
                                               &p1.id,
                                               get_size (0), 0, TIMEOUT,
                                               &notify_ready,

Modified: gnunet/src/transport/test_transport_api_unreliability.c
===================================================================
--- gnunet/src/transport/test_transport_api_unreliability.c     2011-06-17 
10:54:27 UTC (rev 15692)
+++ gnunet/src/transport/test_transport_api_unreliability.c     2011-06-17 
11:53:17 UTC (rev 15693)
@@ -91,6 +91,8 @@
 
 static GNUNET_SCHEDULER_TaskIdentifier tct;
 
+struct GNUNET_TRANSPORT_TransmitHandle * th_p2;
+
 static char *key_file_p1;
 static char *cert_file_p1;
 
@@ -167,6 +169,10 @@
 #if VERBOSE
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from transports!\n");
 #endif
+  if (th_p2 != NULL)
+    GNUNET_TRANSPORT_notify_transmit_ready_cancel(th_p2);
+  th_p2 = NULL;
+
   GNUNET_TRANSPORT_disconnect (p1.th);
   GNUNET_TRANSPORT_disconnect (p2.th);
 #if VERBOSE
@@ -205,6 +211,9 @@
 #if VERBOSE
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Disconnecting from transports!\n");
 #endif
+  if (th_p2 != NULL)
+    GNUNET_TRANSPORT_notify_transmit_ready_cancel(th_p2);
+
   GNUNET_TRANSPORT_disconnect (p1.th);
   GNUNET_TRANSPORT_disconnect (p2.th);
 #if VERBOSE
@@ -253,6 +262,11 @@
              msg_recv, 
              msg_recv_expected);
   GNUNET_break (0);
+
+  if (th_p2 != NULL)
+    GNUNET_TRANSPORT_notify_transmit_ready_cancel(th_p2);
+  th_p2 = NULL;
+
   GNUNET_TRANSPORT_disconnect (p1.th);
   GNUNET_TRANSPORT_disconnect (p2.th);
 
@@ -361,6 +375,8 @@
   unsigned int s;
   unsigned int ret;
 
+  th_p2 = NULL;
+
   if (buf == NULL)
     {
       GNUNET_break (0);
@@ -399,7 +415,7 @@
   while (size - ret >= s);
   if (n < TOTAL_MSGS)
   {
-    GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
+    th_p2 = GNUNET_TRANSPORT_notify_transmit_ready (p2.th,
                                            &p1.id,
                                            s, 0, TIMEOUT,
                                            &notify_ready,




reply via email to

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