gnunet-svn
[Top][All Lists]
Advanced

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

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


From: gnunet
Subject: [GNUnet-SVN] r15509 - gnunet/src/core
Date: Fri, 10 Jun 2011 11:43:54 +0200

Author: grothoff
Date: 2011-06-10 11:43:54 +0200 (Fri, 10 Jun 2011)
New Revision: 15509

Modified:
   gnunet/src/core/test_core_api.c
   gnunet/src/core/test_core_api_peer1.conf
   gnunet/src/core/test_core_api_peer2.conf
   gnunet/src/core/test_core_api_send_to_self.conf
   gnunet/src/core/test_core_quota_asymmetric_recv_limited_peer1.conf
   gnunet/src/core/test_core_quota_asymmetric_recv_limited_peer2.conf
   gnunet/src/core/test_core_quota_asymmetric_send_limit_peer1.conf
   gnunet/src/core/test_core_quota_asymmetric_send_limit_peer2.conf
   gnunet/src/core/test_core_quota_asymmetric_send_limited_peer1.conf
   gnunet/src/core/test_core_quota_asymmetric_send_limited_peer2.conf
   gnunet/src/core/test_core_quota_peer1.conf
   gnunet/src/core/test_core_quota_peer2.conf
Log:
fixing confs

Modified: gnunet/src/core/test_core_api.c
===================================================================
--- gnunet/src/core/test_core_api.c     2011-06-10 09:06:07 UTC (rev 15508)
+++ gnunet/src/core/test_core_api.c     2011-06-10 09:43:54 UTC (rev 15509)
@@ -58,6 +58,8 @@
 
 static GNUNET_SCHEDULER_TaskIdentifier err_task;
 
+static GNUNET_SCHEDULER_TaskIdentifier con_task;
+
 static int ok;
 
 #if VERBOSE
@@ -67,13 +69,31 @@
 #endif
 
 
+static void
+process_hello (void *cls,
+               const struct GNUNET_MessageHeader *message)
+{
+  struct PeerContext *p = cls;
 
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+              "Received (my) `%s' from transport service\n",
+              "HELLO");
+  GNUNET_assert (message != NULL);
+  if ((p == &p1) && (p2.th != NULL))
+    GNUNET_TRANSPORT_offer_hello (p2.th, message, NULL, NULL);
+  if ((p == &p2) && (p1.th != NULL))
+    GNUNET_TRANSPORT_offer_hello (p1.th, message, NULL, NULL);
+}
+
+
 static void
 terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   GNUNET_assert (ok == 6);
   GNUNET_CORE_disconnect (p1.ch);
   GNUNET_CORE_disconnect (p2.ch);
+  GNUNET_TRANSPORT_get_hello_cancel (p1.th, &process_hello, &p1);
+  GNUNET_TRANSPORT_get_hello_cancel (p2.th, &process_hello, &p2);
   GNUNET_TRANSPORT_disconnect (p1.th);
   GNUNET_TRANSPORT_disconnect (p2.th);
   ok = 0;
@@ -89,6 +109,8 @@
   GNUNET_break (0);
   GNUNET_CORE_disconnect (p1.ch);
   GNUNET_CORE_disconnect (p2.ch);
+  GNUNET_TRANSPORT_get_hello_cancel (p1.th, &process_hello, &p1);
+  GNUNET_TRANSPORT_get_hello_cancel (p2.th, &process_hello, &p2);
   GNUNET_TRANSPORT_disconnect (p1.th);
   GNUNET_TRANSPORT_disconnect (p2.th);
   ok = 42;
@@ -108,10 +130,6 @@
   m = (struct GNUNET_MessageHeader *) buf;
   m->type = htons (MTYPE);
   m->size = htons (sizeof (struct GNUNET_MessageHeader));
-  err_task = 
-    GNUNET_SCHEDULER_add_delayed 
(GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 120), 
-                                 &terminate_task_error, NULL);
-
   return sizeof (struct GNUNET_MessageHeader);
 }
 
@@ -128,13 +146,18 @@
                   sizeof (struct GNUNET_PeerIdentity)))
     return;
   GNUNET_assert (pc->connect_status == 0);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Encrypted connection established to peer `%4s'\n",
+             GNUNET_i2s (peer));
+  if (GNUNET_SCHEDULER_NO_TASK != con_task)
+    {
+      GNUNET_SCHEDULER_cancel (con_task);
+      con_task = GNUNET_SCHEDULER_NO_TASK;
+    }
   pc->connect_status = 1;
   if (pc == &p1)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                 "Encrypted connection established to peer `%4s'\n",
-                 GNUNET_i2s (peer));
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                  "Asking core (1) for transmission to peer `%4s'\n",
                  GNUNET_i2s (&p2.id));
       if (NULL == GNUNET_CORE_notify_transmit_ready (p1.ch,
@@ -206,7 +229,7 @@
   GNUNET_assert (ok == 5);
   OKPP;
   GNUNET_SCHEDULER_cancel (err_task);
-  GNUNET_SCHEDULER_add_now (&terminate_task, NULL);
+  err_task = GNUNET_SCHEDULER_add_now (&terminate_task, NULL);
   return GNUNET_OK;
 }
 
@@ -218,6 +241,26 @@
 
 
 static void
+connect_task (void *cls,
+             const struct GNUNET_SCHEDULER_TaskContext *tc)
+{
+  if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
+    {
+      con_task = GNUNET_SCHEDULER_NO_TASK;
+      return;
+    }
+  con_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS,
+                                          &connect_task,
+                                          NULL);
+  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+             "Asking core (1) to connect to peer `%4s'\n",
+             GNUNET_i2s (&p2.id));
+  GNUNET_CORE_peer_request_connect (p1.ch,
+                                   &p2.id,
+                                   NULL, NULL);
+}
+
+static void
 init_notify (void *cls,
              struct GNUNET_CORE_Handle *server,
              const struct GNUNET_PeerIdentity *my_identity,
@@ -236,58 +279,28 @@
       GNUNET_assert (ok == 2);
       OKPP;
       /* connect p2 */
-      GNUNET_CORE_connect (p2.cfg, 1,
-                           &p2,
-                           &init_notify,                        
-                           &connect_notify,
-                           &disconnect_notify,
-                          NULL,
-                           &inbound_notify,
-                           GNUNET_YES,
-                           &outbound_notify, GNUNET_YES, handlers);
+      p2.ch = GNUNET_CORE_connect (p2.cfg, 1,
+                                  &p2,
+                                  &init_notify,                         
+                                  &connect_notify,
+                                  &disconnect_notify,
+                                  NULL,
+                                  &inbound_notify,
+                                  GNUNET_YES,
+                                  &outbound_notify, GNUNET_YES, handlers);
     }
   else
     {
       GNUNET_assert (ok == 3);
       OKPP;
       GNUNET_assert (cls == &p2);
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-                  "Asking core (1) to connect to peer `%4s'\n",
-                  GNUNET_i2s (&p2.id));
-      GNUNET_CORE_peer_request_connect (p1.ch,
-                                       &p2.id,
-                                       NULL, NULL);
+      con_task = GNUNET_SCHEDULER_add_now (&connect_task,
+                                          NULL);
     }
 }
 
 
 static void
-process_hello (void *cls,
-               const struct GNUNET_MessageHeader *message)
-{
-  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");
-  GNUNET_assert (message != NULL);
-  p->hello = GNUNET_malloc (ntohs (message->size));
-  memcpy (p->hello, message, ntohs (message->size));
-  if ((p == &p1) && (p2.th != NULL))
-    GNUNET_TRANSPORT_offer_hello (p2.th, message, NULL, NULL);
-  if ((p == &p2) && (p1.th != NULL))
-    GNUNET_TRANSPORT_offer_hello (p1.th, message, NULL, NULL);
-
-  if ((p == &p1) && (p2.hello != NULL))
-    GNUNET_TRANSPORT_offer_hello (p1.th, p2.hello, NULL, NULL);
-  if ((p == &p2) && (p1.hello != NULL))
-    GNUNET_TRANSPORT_offer_hello (p2.th, p1.hello, NULL, NULL);
-}
-
-
-
-static void
 setup_peer (struct PeerContext *p, const char *cfgname)
 {
   p->cfg = GNUNET_CONFIGURATION_create ();
@@ -316,14 +329,17 @@
   OKPP;
   setup_peer (&p1, "test_core_api_peer1.conf");
   setup_peer (&p2, "test_core_api_peer2.conf");
-  GNUNET_CORE_connect (p1.cfg, 1,
-                       &p1,
-                       &init_notify,
-                      &connect_notify,
-                       &disconnect_notify,
-                      NULL,
-                       &inbound_notify,
-                       GNUNET_YES, &outbound_notify, GNUNET_YES, handlers);
+  err_task = 
+    GNUNET_SCHEDULER_add_delayed 
(GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 120), 
+                                 &terminate_task_error, NULL);
+  p1.ch = GNUNET_CORE_connect (p1.cfg, 1,
+                              &p1,
+                              &init_notify,
+                              &connect_notify,
+                              &disconnect_notify,
+                              NULL,
+                              &inbound_notify,
+                              GNUNET_YES, &outbound_notify, GNUNET_YES, 
handlers);
 }
 
 static void

Modified: gnunet/src/core/test_core_api_peer1.conf
===================================================================
--- gnunet/src/core/test_core_api_peer1.conf    2011-06-10 09:06:07 UTC (rev 
15508)
+++ gnunet/src/core/test_core_api_peer1.conf    2011-06-10 09:43:54 UTC (rev 
15509)
@@ -16,7 +16,7 @@
 #PREFIX= xterm -e xterm -T transport1 -e gdb --args
 #PREFIX = xterm -T transport1 -e gdb --args
 #PREFIX = xterm -T transport1 -e valgrind --tool=memcheck
-#DEBUG = YES
+DEBUG = YES
 
 [arm]
 PORT = 12466
@@ -34,6 +34,15 @@
 #DEBUG = YES
 USE_LOCALADDR = YES 
 
+[nat]
+DISABLEV6 = YES
+BINDTO = 127.0.0.1
+ENABLE_UPNP = NO
+BEHIND_NAT = NO
+ALLOW_NAT = NO
+INTERNAL_ADDRESS = 127.0.0.1
+EXTERNAL_ADDRESS = 127.0.0.1
+
 [peerinfo]
 PORT = 12469
 UNIXPATH = /tmp/gnunet-p1-service-peerinfo.sock

Modified: gnunet/src/core/test_core_api_peer2.conf
===================================================================
--- gnunet/src/core/test_core_api_peer2.conf    2011-06-10 09:06:07 UTC (rev 
15508)
+++ gnunet/src/core/test_core_api_peer2.conf    2011-06-10 09:43:54 UTC (rev 
15509)
@@ -19,6 +19,15 @@
 #PREFIX = xterm -T transport2 -e valgrind --tool=memcheck
 #DEBUG = YES
 
+[nat]
+DISABLEV6 = YES
+BINDTO = 127.0.0.1
+ENABLE_UPNP = NO
+BEHIND_NAT = NO
+ALLOW_NAT = NO
+INTERNAL_ADDRESS = 127.0.0.1
+EXTERNAL_ADDRESS = 127.0.0.1
+
 [arm]
 PORT = 22466
 UNIXPATH = /tmp/gnunet-p2-service-arm.sock

Modified: gnunet/src/core/test_core_api_send_to_self.conf
===================================================================
--- gnunet/src/core/test_core_api_send_to_self.conf     2011-06-10 09:06:07 UTC 
(rev 15508)
+++ gnunet/src/core/test_core_api_send_to_self.conf     2011-06-10 09:43:54 UTC 
(rev 15509)
@@ -38,7 +38,7 @@
 TOTAL_QUOTA_IN = 65536
 TOTAL_QUOTA_OUT = 65536
 UNIXPATH = /tmp/gnunet-service-sts.sock
-DEBUG = YES
+#DEBUG = YES
 
 [core]
 AUTOSTART = YES

Modified: gnunet/src/core/test_core_quota_asymmetric_recv_limited_peer1.conf
===================================================================
--- gnunet/src/core/test_core_quota_asymmetric_recv_limited_peer1.conf  
2011-06-10 09:06:07 UTC (rev 15508)
+++ gnunet/src/core/test_core_quota_asymmetric_recv_limited_peer1.conf  
2011-06-10 09:43:54 UTC (rev 15509)
@@ -35,6 +35,15 @@
 #DEBUG = YES
 USE_LOCALADDR = YES 
 
+[nat]
+DISABLEV6 = YES
+BINDTO = 127.0.0.1
+ENABLE_UPNP = NO
+BEHIND_NAT = NO
+ALLOW_NAT = NO
+INTERNAL_ADDRESS = 127.0.0.1
+EXTERNAL_ADDRESS = 127.0.0.1
+
 [peerinfo]
 PORT = 12489
 UNIXPATH = /tmp/gnunet-core-asym-recv-p1-service-peerinfo.sock

Modified: gnunet/src/core/test_core_quota_asymmetric_recv_limited_peer2.conf
===================================================================
--- gnunet/src/core/test_core_quota_asymmetric_recv_limited_peer2.conf  
2011-06-10 09:06:07 UTC (rev 15508)
+++ gnunet/src/core/test_core_quota_asymmetric_recv_limited_peer2.conf  
2011-06-10 09:43:54 UTC (rev 15509)
@@ -36,6 +36,15 @@
 #DEBUG = YES
 USE_LOCALADDR = YES 
 
+[nat]
+DISABLEV6 = YES
+BINDTO = 127.0.0.1
+ENABLE_UPNP = NO
+BEHIND_NAT = NO
+ALLOW_NAT = NO
+INTERNAL_ADDRESS = 127.0.0.1
+EXTERNAL_ADDRESS = 127.0.0.1
+
 [peerinfo]
 PORT = 22489
 UNIXPATH = /tmp/gnunet-core-asym-recv-p2-service-peerinfo.sock

Modified: gnunet/src/core/test_core_quota_asymmetric_send_limit_peer1.conf
===================================================================
--- gnunet/src/core/test_core_quota_asymmetric_send_limit_peer1.conf    
2011-06-10 09:06:07 UTC (rev 15508)
+++ gnunet/src/core/test_core_quota_asymmetric_send_limit_peer1.conf    
2011-06-10 09:43:54 UTC (rev 15509)
@@ -35,6 +35,15 @@
 #DEBUG = YES
 USE_LOCALADDR = YES 
 
+[nat]
+DISABLEV6 = YES
+BINDTO = 127.0.0.1
+ENABLE_UPNP = NO
+BEHIND_NAT = NO
+ALLOW_NAT = NO
+INTERNAL_ADDRESS = 127.0.0.1
+EXTERNAL_ADDRESS = 127.0.0.1
+
 [peerinfo]
 PORT = 12489
 UNIXPATH = /tmp/gnunet-core-asym-send-p1-service-peerinfo.sock

Modified: gnunet/src/core/test_core_quota_asymmetric_send_limit_peer2.conf
===================================================================
--- gnunet/src/core/test_core_quota_asymmetric_send_limit_peer2.conf    
2011-06-10 09:06:07 UTC (rev 15508)
+++ gnunet/src/core/test_core_quota_asymmetric_send_limit_peer2.conf    
2011-06-10 09:43:54 UTC (rev 15509)
@@ -36,6 +36,15 @@
 #DEBUG = YES
 USE_LOCALADDR = YES 
 
+[nat]
+DISABLEV6 = YES
+BINDTO = 127.0.0.1
+ENABLE_UPNP = NO
+BEHIND_NAT = NO
+ALLOW_NAT = NO
+INTERNAL_ADDRESS = 127.0.0.1
+EXTERNAL_ADDRESS = 127.0.0.1
+
 [peerinfo]
 PORT = 22489
 UNIXPATH = /tmp/gnunet-core-asym-send-p2-service-peerinfo.sock

Modified: gnunet/src/core/test_core_quota_asymmetric_send_limited_peer1.conf
===================================================================
--- gnunet/src/core/test_core_quota_asymmetric_send_limited_peer1.conf  
2011-06-10 09:06:07 UTC (rev 15508)
+++ gnunet/src/core/test_core_quota_asymmetric_send_limited_peer1.conf  
2011-06-10 09:43:54 UTC (rev 15509)
@@ -35,6 +35,15 @@
 #DEBUG = YES
 USE_LOCALADDR = YES 
 
+[nat]
+DISABLEV6 = YES
+BINDTO = 127.0.0.1
+ENABLE_UPNP = NO
+BEHIND_NAT = NO
+ALLOW_NAT = NO
+INTERNAL_ADDRESS = 127.0.0.1
+EXTERNAL_ADDRESS = 127.0.0.1
+
 [peerinfo]
 PORT = 12429
 UNIXPATH = /tmp/gnunet-core-asym-send-p1-service-peerinfo.sock

Modified: gnunet/src/core/test_core_quota_asymmetric_send_limited_peer2.conf
===================================================================
--- gnunet/src/core/test_core_quota_asymmetric_send_limited_peer2.conf  
2011-06-10 09:06:07 UTC (rev 15508)
+++ gnunet/src/core/test_core_quota_asymmetric_send_limited_peer2.conf  
2011-06-10 09:43:54 UTC (rev 15509)
@@ -36,6 +36,15 @@
 #DEBUG = YES
 USE_LOCALADDR = YES 
 
+[nat]
+DISABLEV6 = YES
+BINDTO = 127.0.0.1
+ENABLE_UPNP = NO
+BEHIND_NAT = NO
+ALLOW_NAT = NO
+INTERNAL_ADDRESS = 127.0.0.1
+EXTERNAL_ADDRESS = 127.0.0.1
+
 [peerinfo]
 PORT = 22429
 UNIXPATH = /tmp/gnunet-core-asym-send-p2-service-peerinfo.sock

Modified: gnunet/src/core/test_core_quota_peer1.conf
===================================================================
--- gnunet/src/core/test_core_quota_peer1.conf  2011-06-10 09:06:07 UTC (rev 
15508)
+++ gnunet/src/core/test_core_quota_peer1.conf  2011-06-10 09:43:54 UTC (rev 
15509)
@@ -36,6 +36,15 @@
 #DEBUG = YES
 USE_LOCALADDR = YES 
 
+[nat]
+DISABLEV6 = YES
+BINDTO = 127.0.0.1
+ENABLE_UPNP = NO
+BEHIND_NAT = NO
+ALLOW_NAT = NO
+INTERNAL_ADDRESS = 127.0.0.1
+EXTERNAL_ADDRESS = 127.0.0.1
+
 [peerinfo]
 PORT = 12479
 UNIXPATH = /tmp/gnunet-core-sym-p1-service-peerinfo.sock

Modified: gnunet/src/core/test_core_quota_peer2.conf
===================================================================
--- gnunet/src/core/test_core_quota_peer2.conf  2011-06-10 09:06:07 UTC (rev 
15508)
+++ gnunet/src/core/test_core_quota_peer2.conf  2011-06-10 09:43:54 UTC (rev 
15509)
@@ -36,6 +36,15 @@
 #DEBUG = YES
 USE_LOCALADDR = YES 
 
+[nat]
+DISABLEV6 = YES
+BINDTO = 127.0.0.1
+ENABLE_UPNP = NO
+BEHIND_NAT = NO
+ALLOW_NAT = NO
+INTERNAL_ADDRESS = 127.0.0.1
+EXTERNAL_ADDRESS = 127.0.0.1
+
 [peerinfo]
 PORT = 22479
 UNIXPATH = /tmp/gnunet-core-sym-p2-service-peerinfo.sock




reply via email to

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