[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r1098 - in GNUnet/src/applications: topology_default topolo
From: |
grothoff |
Subject: |
[GNUnet-SVN] r1098 - in GNUnet/src/applications: topology_default topology_f2f |
Date: |
Mon, 27 Jun 2005 10:10:33 -0700 (PDT) |
Author: grothoff
Date: 2005-06-27 10:10:29 -0700 (Mon, 27 Jun 2005)
New Revision: 1098
Modified:
GNUnet/src/applications/topology_default/topology.c
GNUnet/src/applications/topology_f2f/topology.c
Log:
fix
Modified: GNUnet/src/applications/topology_default/topology.c
===================================================================
--- GNUnet/src/applications/topology_default/topology.c 2005-06-27 15:13:50 UTC
(rev 1097)
+++ GNUnet/src/applications/topology_default/topology.c 2005-06-27 17:10:29 UTC
(rev 1098)
@@ -261,14 +261,14 @@
"YES")) )
scanForHosts(i);
}
- if (saturation >= 0.75) {
+ if (randomi(LIVE_SCAN_EFFECTIVENESS) == 0)
active = coreAPI->forAllConnectedNodes
(&checkNeedForPing,
NULL);
- } else {
- active = coreAPI->forAllConnectedNodes(NULL,
- NULL);
- }
+ else
+ active = coreAPI->forAllConnectedNodes
+ (NULL,
+ NULL);
saturation = 1.0 * slotCount / active;
}
Modified: GNUnet/src/applications/topology_f2f/topology.c
===================================================================
--- GNUnet/src/applications/topology_f2f/topology.c 2005-06-27 15:13:50 UTC
(rev 1097)
+++ GNUnet/src/applications/topology_f2f/topology.c 2005-06-27 17:10:29 UTC
(rev 1098)
@@ -213,15 +213,10 @@
* Check the liveness of the ping and possibly ping it.
*/
static void checkNeedForPing(const PeerIdentity * peer,
- int * lastSlot) {
+ void * unused) {
cron_t now;
cron_t act;
- int slot;
- slot = coreAPI->computeIndex(peer);
- if (slot == *lastSlot)
- return; /* slot already in use twice! */
- *lastSlot = slot;
cronTime(&now);
if (SYSERR == coreAPI->getLastActivityOf(peer, &act)) {
BREAK();
@@ -268,14 +263,14 @@
(0 == coreAPI->isSlotUsed(i)) )
scanForHosts(i);
}
- if (saturation >= 0.75) {
- i = -1;
- active = coreAPI->forAllConnectedNodes((PerNodeCallback)&checkNeedForPing,
- &i);
- } else {
- active = coreAPI->forAllConnectedNodes(NULL,
- NULL);
- }
+ if (randomi(LIVE_SCAN_EFFECTIVENESS) == 0)
+ active = coreAPI->forAllConnectedNodes
+ (&checkNeedForPing,
+ NULL);
+ else
+ active = coreAPI->forAllConnectedNodes
+ (NULL,
+ NULL);
saturation = 1.0 * slotCount / active;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r1098 - in GNUnet/src/applications: topology_default topology_f2f,
grothoff <=