gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r24469 - gnunet/src/mesh


From: gnunet
Subject: [GNUnet-SVN] r24469 - gnunet/src/mesh
Date: Tue, 23 Oct 2012 11:13:35 +0200

Author: szengel
Date: 2012-10-23 11:13:35 +0200 (Tue, 23 Oct 2012)
New Revision: 24469

Modified:
   gnunet/src/mesh/gnunet-regex-profiler.c
   gnunet/src/mesh/regex_profiler_test.conf
Log:
regex profiler fixes

Modified: gnunet/src/mesh/gnunet-regex-profiler.c
===================================================================
--- gnunet/src/mesh/gnunet-regex-profiler.c     2012-10-22 23:07:31 UTC (rev 
24468)
+++ gnunet/src/mesh/gnunet-regex-profiler.c     2012-10-23 09:13:35 UTC (rev 
24469)
@@ -465,7 +465,9 @@
 
     prof_time = GNUNET_TIME_absolute_get_duration (prof_start_time);
     printf ("\nAll strings successfully matched in %.2f minutes\n", 
((double)prof_time.rel_value / 1000.0 / 60.0));
-    GNUNET_SCHEDULER_cancel (search_timeout_task);
+
+    if (GNUNET_SCHEDULER_NO_TASK != search_timeout_task)
+      GNUNET_SCHEDULER_cancel (search_timeout_task);
     GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
   }
 }
@@ -507,8 +509,8 @@
   {
     peer = &peers[search_cnt % num_peers];
 
-    printf ("Searching for string \"%s\" on peer %d\n", 
-           search_strings[search_cnt], (search_cnt % num_peers));
+    printf ("Searching for string \"%s\" on peer %d with file %s\n", 
+           search_strings[search_cnt], (search_cnt % num_peers), 
peer->policy_file);
 
     peer->mesh_tunnel_handle = GNUNET_MESH_tunnel_create (peer->mesh_handle,
                                                          NULL,
@@ -593,7 +595,7 @@
       data[offset] = '\0';
       regex = buf;
       GNUNET_assert (NULL != regex);
-      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Announcing regex: %s\n", regex);
+      GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Announcing regex: %s on peer\n", 
regex);
       GNUNET_MESH_announce_regex (peer->mesh_handle, regex);
       buf = &data[offset + 1];
     }
@@ -660,6 +662,7 @@
     GNUNET_MESH_tunnel_destroy (peer->mesh_tunnel_handle);
     peer->mesh_tunnel_handle = NULL;
   }
+
   if (NULL != peer->mesh_handle)
   {
     GNUNET_MESH_disconnect (peer->mesh_handle);
@@ -691,7 +694,8 @@
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
          _("An operation has failed while starting peers\n"));
     GNUNET_TESTBED_operation_done (op);
-    GNUNET_SCHEDULER_cancel (abort_task);
+    if (GNUNET_SCHEDULER_NO_TASK != abort_task)
+      GNUNET_SCHEDULER_cancel (abort_task);
     abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL);
     return;
   }
@@ -702,11 +706,9 @@
     printf ("All peers started successfully in %.2f seconds\n",
             ((double) prof_time.rel_value) / 1000.00);
     result = GNUNET_OK;
+
     if (0 == num_links)
-    {
-      GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
-      return;
-    }
+      num_links = num_peers * 5;
 
     peer_handles = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_Peer *) * 
num_peers);
     for (peer_cnt = 0; peer_cnt < num_peers; peer_cnt++)
@@ -754,7 +756,8 @@
     GNUNET_TESTBED_operation_done (dll_op->op);
     GNUNET_CONTAINER_DLL_remove (dll_op_head, dll_op_tail, dll_op);
     GNUNET_free (dll_op);
-    GNUNET_SCHEDULER_cancel (abort_task);
+    if (GNUNET_SCHEDULER_NO_TASK != abort_task)
+      GNUNET_SCHEDULER_cancel (abort_task);
     abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL);
     return;
   }
@@ -809,6 +812,8 @@
 
   peers[peer_cnt].policy_file = GNUNET_strdup (filename);
   peers[peer_cnt].host_handle = hosts[peer_cnt % num_hosts];
+  peers[peer_cnt].mesh_handle = NULL;
+  peers[peer_cnt].mesh_tunnel_handle = NULL;
 
   dll_op = GNUNET_malloc (sizeof (struct DLLOperation));
   dll_op->cls = &peers[peer_cnt];
@@ -855,7 +860,8 @@
           GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                _("An operation has failed while starting slaves\n"));
           GNUNET_TESTBED_operation_done (op);
-          GNUNET_SCHEDULER_cancel (abort_task);
+         if (GNUNET_SCHEDULER_NO_TASK != abort_task)
+           GNUNET_SCHEDULER_cancel (abort_task);
           abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL);
           return;
         }
@@ -908,7 +914,8 @@
        if (++cont_fails > num_cont_fails)
        {
          printf ("\nAborting due to very high failure rate");
-         GNUNET_SCHEDULER_cancel (abort_task);
+         if (GNUNET_SCHEDULER_NO_TASK != abort_task)
+           GNUNET_SCHEDULER_cancel (abort_task);
          abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL);
        }
       }
@@ -981,7 +988,8 @@
   {
     GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                 _("Host registration failed for a host. Error: %s\n"), emsg);
-    GNUNET_SCHEDULER_cancel (abort_task);
+    if (GNUNET_SCHEDULER_NO_TASK != abort_task)
+      GNUNET_SCHEDULER_cancel (abort_task);
     abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL);
     return;
   }
@@ -1040,7 +1048,8 @@
 static void
 status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *config, int 
status)
 {
-  GNUNET_SCHEDULER_cancel (abort_task);
+  if (GNUNET_SCHEDULER_NO_TASK != abort_task)
+    GNUNET_SCHEDULER_cancel (abort_task);
   if (GNUNET_OK != status)
   {
     mc_proc = NULL;
@@ -1239,7 +1248,7 @@
   static const struct GNUNET_GETOPT_CommandLineOption options[] = {
     { 'n', "num-links", "COUNT",
       gettext_noop ("create COUNT number of random links"),
-      GNUNET_YES, &GNUNET_GETOPT_set_uint, &num_links },
+      GNUNET_NO, &GNUNET_GETOPT_set_uint, &num_links },
     { 'e', "num-errors", "COUNT",
       gettext_noop ("tolerate COUNT number of continious timeout failures"),
       GNUNET_YES, &GNUNET_GETOPT_set_uint, &num_cont_fails },

Modified: gnunet/src/mesh/regex_profiler_test.conf
===================================================================
--- gnunet/src/mesh/regex_profiler_test.conf    2012-10-22 23:07:31 UTC (rev 
24468)
+++ gnunet/src/mesh/regex_profiler_test.conf    2012-10-23 09:13:35 UTC (rev 
24469)
@@ -1,57 +1,59 @@
 [testbed]
 AUTOSTART = NO
-PORT = 12113
+PORT = 12000
 ACCEPT_FROM = 127.0.0.1; 192.168.1.0/24;
 HOSTNAME = localhost
 MAX_PARALLEL_TOPOLOGY_CONFIG_OPERATIONS = 5
 MAX_PARALLEL_OVERLAY_CONNECT_OPERATIONS = 5
 
+[mesh]
+AUTOSTART = YES
+ACCEPT_FROM = 127.0.0.1; 192.168.1.0/24;
+APP_ANNOUNCE_TIME = 10 s
+ID_ANNOUNCE_TIME = 10 s
+CONNECT_TIMEOUT = 30 s
+PORT = 12001
+
+[dht]
+AUTOSTART = YES
+ACCEPT_FROM = 127.0.0.1; 192.168.1.0/24;
+PORT = 12002
+HOSTNAME = localhost
+
+[arm]
+DEFAULTSERVICES = core dht mesh
+PORT = 12003
+DEBUG = NO
+
 [fs]
 AUTOSTART = NO
 
 [resolver]
 AUTOSTART = NO
 
-[mesh]
-AUTOSTART = NO
-APP_ANNOUNCE_TIME = 5 s
-ID_ANNOUNCE_TIME = 5 s
-CONNECT_TIMEOUT = 10 s
-
-[dht]
-AUTOSTART = NO
-
 [block]
-plugins = dht test
+plugins = dht mesh
 
-[dhtcache]
-QUOTA = 1 MB
-DATABASE = sqlite
-
 [transport]
+AUTOSTART = YES
 PLUGINS = tcp
 DEBUG = NO
+ACCEPT_FROM = 127.0.0.1; 192.168.1.0/24;
 ACCEPT_FROM6 = ::1;
-ACCEPT_FROM = 127.0.0.1;
 NEIGHBOUR_LIMIT = 50
-PORT = 12365
+PORT = 12004
 
 [ats]
 WAN_QUOTA_OUT = 3932160
 WAN_QUOTA_IN = 3932160
 
 [core]
-PORT = 12092
+PORT = 12005
 AUTOSTART = YES
 
-[arm]
-DEFAULTSERVICES = core mesh dht
-PORT = 12366
-DEBUG = NO
-
 [transport-tcp]
 TIMEOUT = 300 s
-PORT = 12368
+PORT = 12006
 
 [TESTING]
 NUM_PEERS = 5




reply via email to

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