gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r5185 - GNUnet/src/server


From: gnunet
Subject: [GNUnet-SVN] r5185 - GNUnet/src/server
Date: Fri, 29 Jun 2007 22:47:12 -0600 (MDT)

Author: grothoff
Date: 2007-06-29 22:47:12 -0600 (Fri, 29 Jun 2007)
New Revision: 5185

Modified:
   GNUnet/src/server/connection.c
Log:
enforce rule that whenever a session goes down, it cannot go back up for 1h

Modified: GNUnet/src/server/connection.c
===================================================================
--- GNUnet/src/server/connection.c      2007-06-30 04:35:14 UTC (rev 5184)
+++ GNUnet/src/server/connection.c      2007-06-30 04:47:12 UTC (rev 5185)
@@ -2465,6 +2465,10 @@
         would indicate a plaintex msg).  So we set the limit to the
         minimum value AND try to shutdown the connection. */
       be->idealized_limit = MIN_BPM_PER_PEER;
+      /* do not try to reconnect any time soon! */
+      identity->blacklistHost(&be->session.sender,
+                             60 * 60, /* wait at least 1h */
+                             YES);
       shutdownConnection(be);
     } else {
 #if 0
@@ -2557,9 +2561,12 @@
                 &enc,
                 now - root->isAlive);
 #endif
+         /* do not try to reconnect any time soon! */
+         identity->blacklistHost(&root->session.sender,
+                                 60 * 60, /* wait at least 1h */
+                                 YES);
           shutdownConnection(root);
-          /* the host may still be worth trying again soon: */
-          identity->whitelistHost(&root->session.sender);
+
         }
         if ( (root->available_send_window > 35 * 1024) &&
             (root->sendBufferSize < 4) &&
@@ -2617,6 +2624,10 @@
                 &enc,
                 (root->status == STAT_SETKEY_SENT) ? "SETKEY" : "PING");
 #endif
+         /* do not try to reconnect any time soon! */
+         identity->blacklistHost(&root->session.sender,
+                                 60 * 60, /* wait at least 1h */
+                                 YES);
           shutdownConnection(root);
         }
         break;
@@ -2809,7 +2820,7 @@
 #endif
 
   ENTRY();
-  if(ntohs(msg->size) != sizeof(P2P_hangup_MESSAGE))
+  if (ntohs(msg->size) != sizeof(P2P_hangup_MESSAGE))
     return SYSERR;
   if(0 != memcmp(sender,
                 &((P2P_hangup_MESSAGE *) msg)->sender,
@@ -2832,7 +2843,7 @@
     return SYSERR;
   }
   /* do not try to reconnect any time soon! */
-  identity->blacklistHost(sender,
+  identity->blacklistHost(&be->session.sender,
                          60 * 60, /* wait at least 1h */
                          YES);
   shutdownConnection(be);
@@ -3705,7 +3716,7 @@
   ENTRY();
   MUTEX_LOCK(lock);
   be = lookForHost(node);
-  if(be != NULL) {
+  if (be != NULL) {
 #if DEBUG_CONNECTION
     EncName enc;
 
@@ -3718,6 +3729,10 @@
           "Closing connection to `%s' as requested by application.\n",
           &enc);
 #endif
+    /* do not try to reconnect any time soon! */
+    identity->blacklistHost(&be->session.sender,
+                           60 * 60, /* wait at least 1h */
+                           YES);
     shutdownConnection(be);
   }
   MUTEX_UNLOCK(lock);





reply via email to

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