aboutsummaryrefslogtreecommitdiff
path: root/src/vpn
diff options
context:
space:
mode:
Diffstat (limited to 'src/vpn')
-rw-r--r--src/vpn/vpn_api.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/vpn/vpn_api.c b/src/vpn/vpn_api.c
index 494c6d857..81282960e 100644
--- a/src/vpn/vpn_api.c
+++ b/src/vpn/vpn_api.c
@@ -64,6 +64,11 @@ struct GNUNET_VPN_Handle
64 GNUNET_SCHEDULER_TaskIdentifier rt; 64 GNUNET_SCHEDULER_TaskIdentifier rt;
65 65
66 /** 66 /**
67 * How long do we wait until we try to reconnect?
68 */
69 struct GNUNET_TIME_Relative backoff;
70
71 /**
67 * ID of the last request that was submitted to the service. 72 * ID of the last request that was submitted to the service.
68 */ 73 */
69 uint64_t request_id_gen; 74 uint64_t request_id_gen;
@@ -402,7 +407,10 @@ reconnect (struct GNUNET_VPN_Handle *vh)
402 vh->request_id_gen = 0; 407 vh->request_id_gen = 0;
403 for (rr = vh->rr_head; NULL != rr; rr = rr->next) 408 for (rr = vh->rr_head; NULL != rr; rr = rr->next)
404 rr->request_id = 0; 409 rr->request_id = 0;
405 vh->rt = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, 410 vh->backoff = GNUNET_TIME_relative_max (GNUNET_TIME_UNIT_MILLISECONDS,
411 GNUNET_TIME_relative_min (GNUNET_TIME_relative_multiply (vh->backoff, 2),
412 GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30)));
413 vh->rt = GNUNET_SCHEDULER_add_delayed (vh->backoff,
406 &connect_task, 414 &connect_task,
407 vh); 415 vh);
408} 416}