gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r23840 - gnunet/src/testbed


From: gnunet
Subject: [GNUnet-SVN] r23840 - gnunet/src/testbed
Date: Mon, 17 Sep 2012 12:02:11 +0200

Author: harsha
Date: 2012-09-17 12:02:11 +0200 (Mon, 17 Sep 2012)
New Revision: 23840

Modified:
   gnunet/src/testbed/gnunet-service-testbed.c
   gnunet/src/testbed/test_testbed_api_2peers_2controllers.c
Log:
fixes and working testcase for 2peers_2controllers

Modified: gnunet/src/testbed/gnunet-service-testbed.c
===================================================================
--- gnunet/src/testbed/gnunet-service-testbed.c 2012-09-17 09:46:32 UTC (rev 
23839)
+++ gnunet/src/testbed/gnunet-service-testbed.c 2012-09-17 10:02:11 UTC (rev 
23840)
@@ -977,6 +977,8 @@
   uint16_t msize;
 
   msize = ntohs (msg->size);
+  LOG_DEBUG ("Relaying message with type: %u, size: %u\n", ntohs (msg->type),
+             msize);
   dup_msg = GNUNET_malloc (msize);
   (void) memcpy (dup_msg, msg, msize);
   queue_message (fopc->client, dup_msg);
@@ -2134,7 +2136,7 @@
     msg = GNUNET_malloc (msize);
     msg->header.type = htons (GNUNET_MESSAGE_TYPE_TESTBED_REQUESTCONNECT);
     msg->header.size = htons (msize);
-    msg->peer = htonl (occ->peer->id);
+    msg->peer = htonl (occ->other_peer->id);
     msg->operation_id = GNUNET_htonll (occ->op_id);
     (void) memcpy (&msg->peer_identity, &occ->peer_identity,
                   sizeof (struct GNUNET_PeerIdentity));
@@ -2148,11 +2150,11 @@
               GNUNET_i2s (&occ->peer_identity), other_peer_str);
     GNUNET_TRANSPORT_offer_hello (occ->p2th, occ->hello, NULL, NULL);
     GNUNET_TRANSPORT_try_connect (occ->p2th, &occ->peer_identity);
+    occ->send_hello_task =
+        GNUNET_SCHEDULER_add_delayed (TRANSPORT_TRY_CONNECT_TIMEOUT,
+                                      &send_hello, occ);
   }
-  GNUNET_free (other_peer_str);
-  occ->send_hello_task =
-      GNUNET_SCHEDULER_add_delayed (TRANSPORT_TRY_CONNECT_TIMEOUT,
-                                    &send_hello, occ);
+  GNUNET_free (other_peer_str);  
 }
 
 /**
@@ -2371,6 +2373,7 @@
        GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
                                      (GNUNET_TIME_UNIT_SECONDS, 30),
                                      &timeout_overlay_connect, occ);
+    GNUNET_SERVER_receive_done (client, GNUNET_OK);
     return;
   }
   GNUNET_TESTING_peer_get_identity (occ->other_peer->details.local.peer,
@@ -2710,7 +2713,7 @@
     {&handle_overlay_connect, NULL, GNUNET_MESSAGE_TYPE_TESTBED_OLCONNECT,
      sizeof (struct GNUNET_TESTBED_OverlayConnectMessage)},
     {&handle_overlay_request_connect, NULL, 
GNUNET_MESSAGE_TYPE_TESTBED_REQUESTCONNECT,
-     sizeof (struct GNUNET_TESTBED_OverlayConnectMessage)},
+     0},
     {NULL}
   };
 

Modified: gnunet/src/testbed/test_testbed_api_2peers_2controllers.c
===================================================================
--- gnunet/src/testbed/test_testbed_api_2peers_2controllers.c   2012-09-17 
09:46:32 UTC (rev 23839)
+++ gnunet/src/testbed/test_testbed_api_2peers_2controllers.c   2012-09-17 
10:02:11 UTC (rev 23840)
@@ -230,6 +230,7 @@
   if (NULL != cp2)
     GNUNET_TESTBED_controller_stop (cp2);
   GNUNET_TESTBED_host_destroy (host);
+  GNUNET_TESTBED_host_destroy (neighbour);
 }
 
 
@@ -456,18 +457,20 @@
     {
       peer1.is_running = GNUNET_NO;
       GNUNET_TESTBED_operation_done (peer1.operation);
-      peer1.operation = GNUNET_TESTBED_peer_destroy (peer1.peer);
     }
     else if (event->details.peer_stop.peer == peer2.peer)
     {
       peer2.is_running = GNUNET_NO;
       GNUNET_TESTBED_operation_done (peer2.operation);
-      peer2.operation = GNUNET_TESTBED_peer_destroy (peer2.peer);
     }
     else
       GNUNET_assert (0);
     if ((GNUNET_NO == peer1.is_running) && (GNUNET_NO == peer2.is_running))
+    {
       result = PEERS_STOPPED;
+      peer1.operation = GNUNET_TESTBED_peer_destroy (peer1.peer);
+      peer2.operation = GNUNET_TESTBED_peer_destroy (peer2.peer);
+    }
     break;
   case GNUNET_TESTBED_ET_CONNECT:
     switch (result)




reply via email to

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