summaryrefslogtreecommitdiff
path: root/src/transport/gnunet-service-transport_ats.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-02-12 14:25:33 +0000
committerChristian Grothoff <christian@grothoff.org>2015-02-12 14:25:33 +0000
commitb08879fa56e3c3979466650ae07c55ac8873fb28 (patch)
tree4f84920cb7f79a70f9b443141caa26ea46fb1dd4 /src/transport/gnunet-service-transport_ats.c
parent4a1ac10330cedb8c26fa1ac82ca4ae156addbf6c (diff)
reset blocking time for addresses upon successful connection
Diffstat (limited to 'src/transport/gnunet-service-transport_ats.c')
-rw-r--r--src/transport/gnunet-service-transport_ats.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/transport/gnunet-service-transport_ats.c b/src/transport/gnunet-service-transport_ats.c
index d204a8950..5301090ff 100644
--- a/src/transport/gnunet-service-transport_ats.c
+++ b/src/transport/gnunet-service-transport_ats.c
@@ -345,6 +345,32 @@ GST_ats_block_address (const struct GNUNET_HELLO_Address *address,
/**
+ * 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