From: Bart Polot Date: Sat, 30 Nov 2013 01:31:11 +0000 (+0000) Subject: - initialize timers X-Git-Tag: initial-import-from-subversion-38251~5844 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=46364cf0f70240da919cc24eea81a10c44feb707;p=oweals%2Fgnunet.git - initialize timers --- diff --git a/src/mesh/gnunet-service-mesh_channel.c b/src/mesh/gnunet-service-mesh_channel.c index 0739ad021..5a97cb655 100644 --- a/src/mesh/gnunet-service-mesh_channel.c +++ b/src/mesh/gnunet-service-mesh_channel.c @@ -733,7 +733,10 @@ ch_message_sent (void *cls, GNUNET_assert (rel->uniq == ch_q); if (MESH_CHANNEL_READY != rel->ch->state) { + struct GNUNET_TIME_Relative delay; + GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == rel->retry_task); + rel->retry_timer = GNUNET_TIME_STD_BACKOFF (rel->retry_timer); rel->retry_task = GNUNET_SCHEDULER_add_delayed (rel->retry_timer, &channel_recreate, rel); } @@ -1041,6 +1044,7 @@ channel_confirm (struct MeshChannel *ch, int fwd) rel = fwd ? ch->root_rel : ch->dest_rel; rel->client_ready = GNUNET_YES; + rel->expected_delay = rel->retry_timer; send_client_ack (ch, fwd); if (GNUNET_SCHEDULER_NO_TASK != rel->retry_task) @@ -1732,6 +1736,7 @@ GMCH_handle_local_create (struct MeshClient *c, /* In unreliable channels, we'll use the DLL to buffer BCK data */ ch->root_rel = GNUNET_new (struct MeshChannelReliability); ch->root_rel->ch = ch; + ch->root_rel->retry_timer = GNUNET_TIME_UNIT_SECONDS; ch->root_rel->expected_delay.rel_value_us = 0; LOG (GNUNET_ERROR_TYPE_DEBUG, "CREATED CHANNEL %s\n", GMCH_2s (ch));