aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/transport/gnunet-service-transport_ats.c26
-rw-r--r--src/transport/gnunet-service-transport_ats.h14
-rw-r--r--src/transport/gnunet-service-transport_neighbours.c9
3 files changed, 41 insertions, 8 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
diff --git a/src/transport/gnunet-service-transport_ats.h b/src/transport/gnunet-service-transport_ats.h
index 780e66f60..bee38d0cd 100644
--- a/src/transport/gnunet-service-transport_ats.h
+++ b/src/transport/gnunet-service-transport_ats.h
@@ -67,8 +67,18 @@ GST_ats_block_address (const struct GNUNET_HELLO_Address *address,
67 struct Session *session); 67 struct Session *session);
68 68
69 69
70/* FIXME: might want to add a function to reset the 70/**
71 back-off from blocking */ 71 * Reset address blocking time. Resets the exponential
72 * back-off timer for this address to zero. Done when
73 * an address was used to create a successful connection.
74 *
75 * @param address the address to reset the blocking timer
76 * @param session the session (can be NULL)
77 */
78void
79GST_ats_block_reset (const struct GNUNET_HELLO_Address *address,
80 struct Session *session);
81
72 82
73/** 83/**
74 * Notify ATS about the a new inbound address. We may already 84 * Notify ATS about the a new inbound address. We may already
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c
index 623712efa..729de12d3 100644
--- a/src/transport/gnunet-service-transport_neighbours.c
+++ b/src/transport/gnunet-service-transport_neighbours.c
@@ -3467,12 +3467,9 @@ GST_neighbours_handle_session_ack (const struct GNUNET_MessageHeader *message,
3467 GNUNET_TRANSPORT_PS_CONNECTED, 3467 GNUNET_TRANSPORT_PS_CONNECTED,
3468 GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT)); 3468 GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_IDLE_CONNECTION_TIMEOUT));
3469 3469
3470 /* Set primary address to used */ 3470 /* Reset backoff for primary address */
3471 set_primary_address (n, 3471 GST_ats_block_reset (n->primary_address.address,
3472 n->primary_address.address, 3472 n->primary_address.session);
3473 n->primary_address.session,
3474 n->primary_address.bandwidth_in,
3475 n->primary_address.bandwidth_out);
3476 return GNUNET_OK; 3473 return GNUNET_OK;
3477} 3474}
3478 3475