gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r1884 - in GNUnet/src/applications: fs/fsui topology_defaul


From: grothoff
Subject: [GNUnet-SVN] r1884 - in GNUnet/src/applications: fs/fsui topology_default topology_f2f
Date: Tue, 23 Aug 2005 23:59:25 -0700 (PDT)

Author: grothoff
Date: 2005-08-23 23:59:22 -0700 (Tue, 23 Aug 2005)
New Revision: 1884

Modified:
   GNUnet/src/applications/fs/fsui/namespace_info.c
   GNUnet/src/applications/fs/fsui/upload.c
   GNUnet/src/applications/topology_default/topology.c
   GNUnet/src/applications/topology_f2f/topology.c
Log:
bad assert

Modified: GNUnet/src/applications/fs/fsui/namespace_info.c
===================================================================
--- GNUnet/src/applications/fs/fsui/namespace_info.c    2005-08-24 05:26:52 UTC 
(rev 1883)
+++ GNUnet/src/applications/fs/fsui/namespace_info.c    2005-08-24 06:59:22 UTC 
(rev 1884)
@@ -1,5 +1,6 @@
 /*
      This file is part of GNUnet
+     (C) 2003, 2004, 2005 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -455,7 +456,7 @@
         uri,
         strlen(uri)+1);
   FREE(uri);
-  GNUNET_ASSERT(OK ==
+  GNUNET_ASSERT(metaSize ==
                ECRS_serializeMetaData(fi->meta,
                                       &((char*)&buf[1])[strlen(uri)+1],
                                       metaSize,

Modified: GNUnet/src/applications/fs/fsui/upload.c
===================================================================
--- GNUnet/src/applications/fs/fsui/upload.c    2005-08-24 05:26:52 UTC (rev 
1883)
+++ GNUnet/src/applications/fs/fsui/upload.c    2005-08-24 06:59:22 UTC (rev 
1884)
@@ -475,6 +475,7 @@
   if (utc->globalUri != NULL)
     ECRS_freeUri(utc->globalUri);
   EXTRACTOR_removeAll(utc->extractors);
+  utc->extractors = NULL;
   utc->tl->isDone = YES;
   FREE(utc);
   FREENONNULL(inboundFN);

Modified: GNUnet/src/applications/topology_default/topology.c
===================================================================
--- GNUnet/src/applications/topology_default/topology.c 2005-08-24 05:26:52 UTC 
(rev 1883)
+++ GNUnet/src/applications/topology_default/topology.c 2005-08-24 06:59:22 UTC 
(rev 1884)
@@ -241,6 +241,8 @@
   EncName enc;
 #endif
 
+  if (weak_randomi(LIVE_PING_EFFECTIVENESS) != 0)
+    return;
   cronTime(&now);
   if (SYSERR == coreAPI->getLastActivityOf(peer, &act)) {
     BREAK();
@@ -297,14 +299,9 @@
         (! autoconnect) )
       scanForHosts(i);
   }
-  if (weak_randomi(LIVE_PING_EFFECTIVENESS) == 0)
-    active = coreAPI->forAllConnectedNodes
-      (&checkNeedForPing,
-       NULL);
-  else 
-    active = coreAPI->forAllConnectedNodes
-      (NULL,
-       NULL);  
+  active = coreAPI->forAllConnectedNodes
+    (&checkNeedForPing,
+     NULL);
   saturation = 1.0 * active / slotCount;
 }
 

Modified: GNUnet/src/applications/topology_f2f/topology.c
===================================================================
--- GNUnet/src/applications/topology_f2f/topology.c     2005-08-24 05:26:52 UTC 
(rev 1883)
+++ GNUnet/src/applications/topology_f2f/topology.c     2005-08-24 06:59:22 UTC 
(rev 1884)
@@ -59,6 +59,11 @@
  */
 #define LIVE_SCAN_EFFECTIVENESS 10
 
+/**
+ * Value < 1 that determines the chance (1:LPE) that the cron job
+ * actually tries to ping a peer that is about to time-out.
+ */
+#define LIVE_PING_EFFECTIVENESS 20
 
 static CoreAPIForApplication * coreAPI;
 
@@ -217,6 +222,8 @@
   cron_t now;
   cron_t act;
 
+  if (weak_randomi(LIVE_PING_EFFECTIVENESS) != 0)
+    return;
   cronTime(&now);
   if (SYSERR == coreAPI->getLastActivityOf(peer, &act)) {
     BREAK();
@@ -263,14 +270,9 @@
         (0 == coreAPI->isSlotUsed(i)) )
       scanForHosts(i);
   }
-  if (weak_randomi(LIVE_SCAN_EFFECTIVENESS) == 0)
-    active = coreAPI->forAllConnectedNodes
-      (&checkNeedForPing,
-       NULL);
-  else 
-    active = coreAPI->forAllConnectedNodes
-      (NULL,
-       NULL);  
+  active = coreAPI->forAllConnectedNodes
+    (&checkNeedForPing,
+     NULL);
   saturation = 1.0 * slotCount / active;
 }
 





reply via email to

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