gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r5174 - in GNUnet: . src/applications/identity src/applicat


From: gnunet
Subject: [GNUnet-SVN] r5174 - in GNUnet: . src/applications/identity src/applications/topology_default src/applications/topology_f2f src/include src/server
Date: Fri, 29 Jun 2007 00:56:39 -0600 (MDT)

Author: grothoff
Date: 2007-06-29 00:56:39 -0600 (Fri, 29 Jun 2007)
New Revision: 5174

Modified:
   GNUnet/ChangeLog
   GNUnet/src/applications/identity/identity.c
   GNUnet/src/applications/topology_default/topology.c
   GNUnet/src/applications/topology_f2f/topology.c
   GNUnet/src/include/gnunet_identity_service.h
   GNUnet/src/server/connection.c
Log:
fixing issue with rapid reconnects

Modified: GNUnet/ChangeLog
===================================================================
--- GNUnet/ChangeLog    2007-06-29 06:22:25 UTC (rev 5173)
+++ GNUnet/ChangeLog    2007-06-29 06:56:39 UTC (rev 5174)
@@ -1,3 +1,6 @@
+Fri Jun 29 00:56:03 MDT 2007
+       Avoid re-connecting shortly after connection was shutdown.
+
 Thu Jun 28 01:10:01 MDT 2007
        Fixed high-latency problems for certain SQLite operations.
        Also improved SQLite performance (but not scalability) a

Modified: GNUnet/src/applications/identity/identity.c
===================================================================
--- GNUnet/src/applications/identity/identity.c 2007-06-29 06:22:25 UTC (rev 
5173)
+++ GNUnet/src/applications/identity/identity.c 2007-06-29 06:56:39 UTC (rev 
5174)
@@ -859,10 +859,7 @@
     return SYSERR;
   }
   if (strict == YES) {
-    /* Presumably runs a broken version of GNUnet;
-       blacklist for 1 day (we hope the other peer
-       updates the software eventually...) */
-    entry->delta = 1 * cronDAYS;
+    entry->delta = desperation;
   } else {
     entry->delta
       = entry->delta + weak_randomi(1+desperation*cronSECONDS);

Modified: GNUnet/src/applications/topology_default/topology.c
===================================================================
--- GNUnet/src/applications/topology_default/topology.c 2007-06-29 06:22:25 UTC 
(rev 5173)
+++ GNUnet/src/applications/topology_default/topology.c 2007-06-29 06:56:39 UTC 
(rev 5174)
@@ -221,7 +221,7 @@
                   0,
                   0);
   identity->blacklistHost(&indexMatch.match,
-                         (int) (saturation * 300),
+                         (unsigned int) (saturation * 5 * 60 * 60), /* 5 hours 
at full saturation */
                          NO);
 }
 

Modified: GNUnet/src/applications/topology_f2f/topology.c
===================================================================
--- GNUnet/src/applications/topology_f2f/topology.c     2007-06-29 06:22:25 UTC 
(rev 5173)
+++ GNUnet/src/applications/topology_f2f/topology.c     2007-06-29 06:56:39 UTC 
(rev 5174)
@@ -224,7 +224,7 @@
                   0,
                   0);
   identity->blacklistHost(&indexMatch.match,
-                         300 + (int) saturation * 600,
+                         (unsigned int) 5 * 60 * 60 * saturation, /* 5h at 
full saturation */
                          NO);
 }
 

Modified: GNUnet/src/include/gnunet_identity_service.h
===================================================================
--- GNUnet/src/include/gnunet_identity_service.h        2007-06-29 06:22:25 UTC 
(rev 5173)
+++ GNUnet/src/include/gnunet_identity_service.h        2007-06-29 06:56:39 UTC 
(rev 5174)
@@ -168,9 +168,14 @@
    * Blacklist a host. This method is called if a host
    * failed to respond to a connection attempt.
    *
-   * @param desparation how desperate are we to connect? [0,MAXHOSTS]
-   *        determines how long the blacklist will be in effect
+   * @param desparation how long the blacklist will be in effect
+   *                    (in seconds)
    * @param strict should we reject incoming connections?
+   *               (and also not possibly attempt to connect
+   *                to this peer from our side)?
+   *               If set to YES, the desperation value
+   *               is also definite, otherwise an algorithm
+   *               for back-off and limiting is applied.
    * @return OK on success SYSERR on error
    */
   int (*blacklistHost)(const PeerIdentity * identity,

Modified: GNUnet/src/server/connection.c
===================================================================
--- GNUnet/src/server/connection.c      2007-06-29 06:22:25 UTC (rev 5173)
+++ GNUnet/src/server/connection.c      2007-06-29 06:56:39 UTC (rev 5174)
@@ -2260,7 +2260,7 @@
               adjustedRR[u],
               entries[u]->max_transmitted_limit, entries[u]->idealized_limit);
         identity->blacklistHost(&entries[u]->session.sender,
-                                1 / topology->getSaturation(),
+                                24 * 60 * 60, /* 1 day */
                                YES);
         shutdownConnection(entries[u]);
         activePeerCount--;
@@ -2831,6 +2831,10 @@
     MUTEX_UNLOCK(lock);
     return SYSERR;
   }
+  /* do not try to reconnect any time soon! */
+  identity->blacklistHost(sender,
+                         60 * 60, /* wait at least 1h */
+                         YES);
   shutdownConnection(be);
   MUTEX_UNLOCK(lock);
   return OK;





reply via email to

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