gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r35237 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r35237 - gnunet/src/transport
Date: Thu, 12 Feb 2015 15:25:33 +0100

Author: grothoff
Date: 2015-02-12 15:25:33 +0100 (Thu, 12 Feb 2015)
New Revision: 35237

Modified:
   gnunet/src/transport/gnunet-service-transport_ats.c
   gnunet/src/transport/gnunet-service-transport_ats.h
   gnunet/src/transport/gnunet-service-transport_neighbours.c
Log:
reset blocking time for addresses upon successful connection

Modified: gnunet/src/transport/gnunet-service-transport_ats.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_ats.c 2015-02-12 14:22:43 UTC 
(rev 35236)
+++ gnunet/src/transport/gnunet-service-transport_ats.c 2015-02-12 14:25:33 UTC 
(rev 35237)
@@ -345,6 +345,32 @@
 
 
 /**
+ * Reset address blocking time.  Resets the exponential
+ * back-off timer for this address to zero.  Done when
+ * an address was used to create a successful connection.
+ *
+ * @param address the address to reset the blocking timer
+ * @param session the session (can be NULL)
+ */
+void
+GST_ats_block_reset (const struct GNUNET_HELLO_Address *address,
+                     struct Session *session)
+{
+  struct AddressInfo *ai;
+
+  ai = find_ai (address, session);
+  if (NULL == ai)
+  {
+    GNUNET_break (0);
+    return;
+  }
+  /* address is in successful use, so it should not be blocked right now */
+  GNUNET_break (NULL == ai->unblock_task);
+  ai->back_off = GNUNET_TIME_UNIT_ZERO;
+}
+
+
+/**
  * Notify ATS about the a new inbound address. We may already
  * know the address (as this is called each time we receive
  * a message from an inbound connection).  If the address is

Modified: gnunet/src/transport/gnunet-service-transport_ats.h
===================================================================
--- gnunet/src/transport/gnunet-service-transport_ats.h 2015-02-12 14:22:43 UTC 
(rev 35236)
+++ gnunet/src/transport/gnunet-service-transport_ats.h 2015-02-12 14:25:33 UTC 
(rev 35237)
@@ -67,9 +67,19 @@
                        struct Session *session);
 
 
-/* FIXME: might want to add a function to reset the
-   back-off from blocking */
+/**
+ * Reset address blocking time.  Resets the exponential
+ * back-off timer for this address to zero.  Done when
+ * an address was used to create a successful connection.
+ *
+ * @param address the address to reset the blocking timer
+ * @param session the session (can be NULL)
+ */
+void
+GST_ats_block_reset (const struct GNUNET_HELLO_Address *address,
+                     struct Session *session);
 
+
 /**
  * Notify ATS about the a new inbound address.  We may already
  * know the address (as this is called each time we receive

Modified: gnunet/src/transport/gnunet-service-transport_neighbours.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_neighbours.c  2015-02-12 
14:22:43 UTC (rev 35236)
+++ gnunet/src/transport/gnunet-service-transport_neighbours.c  2015-02-12 
14:25:33 UTC (rev 35237)
@@ -3467,12 +3467,9 @@
                          GNUNET_TRANSPORT_PS_CONNECTED,
                          GNUNET_TIME_relative_to_absolute 
(GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT));
 
-  /* Set primary address to used */
-  set_primary_address (n,
-                       n->primary_address.address,
-                       n->primary_address.session,
-                       n->primary_address.bandwidth_in,
-                       n->primary_address.bandwidth_out);
+  /* Reset backoff for primary address  */
+  GST_ats_block_reset (n->primary_address.address,
+                       n->primary_address.session);
   return GNUNET_OK;
 }
 




reply via email to

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