gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r4854 - in GNUnet/src: applications/advertising application


From: gnunet
Subject: [GNUnet-SVN] r4854 - in GNUnet/src: applications/advertising applications/identity applications/topology_default util/cron
Date: Tue, 29 May 2007 01:30:02 -0600 (MDT)

Author: grothoff
Date: 2007-05-29 01:30:02 -0600 (Tue, 29 May 2007)
New Revision: 4854

Modified:
   GNUnet/src/applications/advertising/advertising.c
   GNUnet/src/applications/advertising/advertising_test.c
   GNUnet/src/applications/identity/identity.c
   GNUnet/src/applications/topology_default/topology.c
   GNUnet/src/util/cron/cron.c
Log:
fixes

Modified: GNUnet/src/applications/advertising/advertising.c
===================================================================
--- GNUnet/src/applications/advertising/advertising.c   2007-05-29 06:47:54 UTC 
(rev 4853)
+++ GNUnet/src/applications/advertising/advertising.c   2007-05-29 07:30:02 UTC 
(rev 4854)
@@ -48,9 +48,9 @@
 
 /**
  * From time to time, forward one hello from one peer to
- * a random other peer.
+ * a random other peer. 
  */
-#define HELLO_FORWARD_FREQUENCY (4 * cronMINUTES)
+#define HELLO_FORWARD_FREQUENCY (45 * cronSECONDS) 
 
 /**
  * Meanings of the bits in activeCronJobs (ACJ).
@@ -555,8 +555,8 @@
   if (os_network_monitor_get_load(coreAPI->load_monitor,
                                  Upload) > 100)
     return; /* network load too high... */
-  if (weak_randomi(fcc->prob) != 0)
-    return; /* only forward with a certain chance */
+  if (weak_randomi(fcc->prob) != 0) 
+    return; /* only forward with a certain chance */  
   if (equalsHashCode512(&peer->hashPubKey,
                        &fcc->msg->senderIdentity.hashPubKey))
     return; /* do not bounce the hello of a peer back
@@ -735,22 +735,24 @@
     if (YES != GC_get_configuration_value_yesno(cfg,
                                                "NETWORK",
                                                "HELLOEXCHANGE",
-                                               YES))
+                                               YES)) {
       cron_del_job(coreAPI->cron,
                   &forwardhello,
                   HELLO_FORWARD_FREQUENCY,
                   NULL); /* seven minutes: exchange */
+    }
     activeCronJobs -= ACJ_FORWARD;
   } else {
     if (YES == GC_get_configuration_value_yesno(cfg,
                                                "NETWORK",
                                                "HELLOEXCHANGE",
-                                               YES))
+                                               YES)) {
       cron_add_job(coreAPI->cron,
                   &forwardhello,
                   15 * cronSECONDS,
                   HELLO_FORWARD_FREQUENCY,
                   NULL);
+    }
     activeCronJobs += ACJ_FORWARD;
   }
   return 0;

Modified: GNUnet/src/applications/advertising/advertising_test.c
===================================================================
--- GNUnet/src/applications/advertising/advertising_test.c      2007-05-29 
06:47:54 UTC (rev 4853)
+++ GNUnet/src/applications/advertising/advertising_test.c      2007-05-29 
07:30:02 UTC (rev 4854)
@@ -33,7 +33,7 @@
 
 #define NUM_PEERS 12
 
-#define NUM_ROUNDS 3000
+#define NUM_ROUNDS 10
 
 static int countConnections(const char * name,
                            unsigned long long value,
@@ -129,7 +129,7 @@
            found, 
            k,
            min);
-    PTHREAD_SLEEP(15 * cronSECONDS);
+    PTHREAD_SLEEP(45 * cronSECONDS); /* one hello-forward round is 45s! */
   }
   gnunet_testing_stop_daemons(peers);
   GC_free(cfg);

Modified: GNUnet/src/applications/identity/identity.c
===================================================================
--- GNUnet/src/applications/identity/identity.c 2007-05-29 06:47:54 UTC (rev 
4853)
+++ GNUnet/src/applications/identity/identity.c 2007-05-29 07:30:02 UTC (rev 
4854)
@@ -787,7 +787,8 @@
   HostEntry * entry;
   int i;
 
-  GE_ASSERT(ectx, numberOfHosts_ <= sizeOfHosts_);
+  GE_ASSERT(ectx,
+           numberOfHosts_ <= sizeOfHosts_);
   MUTEX_LOCK(lock_);
   entry = findHost(identity);
   if (entry == NULL) {
@@ -1069,8 +1070,12 @@
   struct stat hostStat;
   int hostFile;
 
-  fn = (char *) MALLOC(strlen(filename) + strlen(dirname) + 2);
-  sprintf(fn, "%s%s%s", dirname, DIR_SEPARATOR_STR, filename);
+  fn = MALLOC(strlen(filename) + strlen(dirname) + 2);
+  sprintf(fn, 
+         "%s%s%s",
+         dirname,
+         DIR_SEPARATOR_STR,
+         filename);
   hostFile = disk_file_open(ectx,
                            fn,
                            O_WRONLY);

Modified: GNUnet/src/applications/topology_default/topology.c
===================================================================
--- GNUnet/src/applications/topology_default/topology.c 2007-05-29 06:47:54 UTC 
(rev 4853)
+++ GNUnet/src/applications/topology_default/topology.c 2007-05-29 07:30:02 UTC 
(rev 4854)
@@ -39,7 +39,7 @@
 #include "gnunet_transport_service.h"
 #include "gnunet_pingpong_service.h"
 
-#define DEBUG_TOPOLOGY NO
+#define DEBUG_TOPOLOGY YES
 
 /**
  * After 2 minutes on an inactive connection, probe the other
@@ -221,7 +221,7 @@
                   0,
                   0);
   identity->blacklistHost(&indexMatch.match,
-                         600 + (int) (saturation * 600),
+                         (int) (saturation * 300),
                          NO);
 }
 
@@ -291,12 +291,13 @@
     minint = 10;
   if (minint == 0)
     minint = 1;
-  for (i=slotCount-1;i>=0;i--) {
-    if (weak_randomi(LIVE_SCAN_EFFECTIVENESS) != 0)
-      continue;
-    if ( (minint > coreAPI->isSlotUsed(i)) &&
-        (NO == autoconnect) )
-      scanForHosts(i);
+  if (NO == autoconnect) {
+    for (i=slotCount-1;i>=0;i--) {
+      if (weak_randomi(LIVE_SCAN_EFFECTIVENESS) != 0)
+       continue;
+      if (minint > coreAPI->isSlotUsed(i))     
+       scanForHosts(i);
+    }
   }
   active = coreAPI->forAllConnectedNodes
     (&checkNeedForPing,

Modified: GNUnet/src/util/cron/cron.c
===================================================================
--- GNUnet/src/util/cron/cron.c 2007-05-29 06:47:54 UTC (rev 4853)
+++ GNUnet/src/util/cron/cron.c 2007-05-29 07:30:02 UTC (rev 4854)
@@ -521,7 +521,7 @@
                 data);
   }
   /* run */
-#if DEBUG_CRON
+#if DEBUG_CRON 
   GE_LOG(cron->ectx,
         GE_STATUS | GE_DEVELOPER | GE_BULK,
         "running job %p-%p\n",
@@ -530,13 +530,13 @@
 #endif
   method(data);
   MUTEX_LOCK(cron->deltaListLock_);
-  cron->runningJob_ = NULL;
-#if DEBUG_CRON
+  cron->runningJob_ = NULL;  
+#if DEBUG_CRON 
   GE_LOG(cron->ectx,
         GE_STATUS | GE_DEVELOPER | GE_BULK,
         "job %p-%p done\n",
         method,
-        data);
+        data);  
 #endif
 }
 





reply via email to

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