diff options
Diffstat (limited to 'src/ats/ats_api_scheduling.c')
-rw-r--r-- | src/ats/ats_api_scheduling.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ats/ats_api_scheduling.c b/src/ats/ats_api_scheduling.c index 1ed89e86e..fb6df4494 100644 --- a/src/ats/ats_api_scheduling.c +++ b/src/ats/ats_api_scheduling.c | |||
@@ -145,6 +145,11 @@ struct GNUNET_ATS_SchedulingHandle | |||
145 | struct GNUNET_SCHEDULER_Task *task; | 145 | struct GNUNET_SCHEDULER_Task *task; |
146 | 146 | ||
147 | /** | 147 | /** |
148 | * Reconnect backoff delay. | ||
149 | */ | ||
150 | struct GNUNET_TIME_Relative backoff; | ||
151 | |||
152 | /** | ||
148 | * Size of the @e session_array. | 153 | * Size of the @e session_array. |
149 | */ | 154 | */ |
150 | unsigned int session_array_size; | 155 | unsigned int session_array_size; |
@@ -200,7 +205,8 @@ force_reconnect (struct GNUNET_ATS_SchedulingHandle *sh) | |||
200 | NULL, NULL, NULL, | 205 | NULL, NULL, NULL, |
201 | GNUNET_BANDWIDTH_ZERO, | 206 | GNUNET_BANDWIDTH_ZERO, |
202 | GNUNET_BANDWIDTH_ZERO); | 207 | GNUNET_BANDWIDTH_ZERO); |
203 | sh->task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, | 208 | sh->backoff = GNUNET_TIME_STD_BACKOFF (sh->backoff); |
209 | sh->task = GNUNET_SCHEDULER_add_delayed (sh->backoff, | ||
204 | &reconnect_task, | 210 | &reconnect_task, |
205 | sh); | 211 | sh); |
206 | } | 212 | } |
@@ -432,6 +438,7 @@ process_ats_address_suggestion_message (void *cls, | |||
432 | GNUNET_break (0); | 438 | GNUNET_break (0); |
433 | return; | 439 | return; |
434 | } | 440 | } |
441 | sh->backoff = GNUNET_TIME_UNIT_ZERO; | ||
435 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 442 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
436 | "ATS suggests address slot %u for peer `%s' using plugin %s\n", | 443 | "ATS suggests address slot %u for peer `%s' using plugin %s\n", |
437 | ar->slot, | 444 | ar->slot, |