aboutsummaryrefslogtreecommitdiff
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)
downloadgnunet-b08879fa56e3c3979466650ae07c55ac8873fb28.tar.gz
gnunet-b08879fa56e3c3979466650ae07c55ac8873fb28.zip
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,
345 345
346 346
347/** 347/**
348 * Reset address blocking time. Resets the exponential
349 * back-off timer for this address to zero. Done when
350 * an address was used to create a successful connection.
351 *
352 * @param address the address to reset the blocking timer
353 * @param session the session (can be NULL)
354 */
355void
356GST_ats_block_reset (const struct GNUNET_HELLO_Address *address,
357 struct Session *session)
358{
359 struct AddressInfo *ai;
360
361 ai = find_ai (address, session);
362 if (NULL == ai)
363 {
364 GNUNET_break (0);
365 return;
366 }
367 /* address is in successful use, so it should not be blocked right now */
368 GNUNET_break (NULL == ai->unblock_task);
369 ai->back_off = GNUNET_TIME_UNIT_ZERO;
370}
371
372
373/**
348 * Notify ATS about the a new inbound address. We may already 374 * Notify ATS about the a new inbound address. We may already
349 * know the address (as this is called each time we receive 375 * know the address (as this is called each time we receive
350 * a message from an inbound connection). If the address is 376 * a message from an inbound connection). If the address is