aboutsummaryrefslogtreecommitdiff
path: root/src/mesh/gnunet-service-mesh_channel.c
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-11-30 01:31:11 +0000
committerBart Polot <bart@net.in.tum.de>2013-11-30 01:31:11 +0000
commit46364cf0f70240da919cc24eea81a10c44feb707 (patch)
treed7da0abed7b05bdf44355f5912081d22329a27e1 /src/mesh/gnunet-service-mesh_channel.c
parentea45834dfdb68b7c6c3c2fc5b560b23d6e6aa505 (diff)
downloadgnunet-46364cf0f70240da919cc24eea81a10c44feb707.tar.gz
gnunet-46364cf0f70240da919cc24eea81a10c44feb707.zip
- initialize timers
Diffstat (limited to 'src/mesh/gnunet-service-mesh_channel.c')
-rw-r--r--src/mesh/gnunet-service-mesh_channel.c5
1 files changed, 5 insertions, 0 deletions
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,
733 GNUNET_assert (rel->uniq == ch_q); 733 GNUNET_assert (rel->uniq == ch_q);
734 if (MESH_CHANNEL_READY != rel->ch->state) 734 if (MESH_CHANNEL_READY != rel->ch->state)
735 { 735 {
736 struct GNUNET_TIME_Relative delay;
737
736 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == rel->retry_task); 738 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == rel->retry_task);
739 rel->retry_timer = GNUNET_TIME_STD_BACKOFF (rel->retry_timer);
737 rel->retry_task = GNUNET_SCHEDULER_add_delayed (rel->retry_timer, 740 rel->retry_task = GNUNET_SCHEDULER_add_delayed (rel->retry_timer,
738 &channel_recreate, rel); 741 &channel_recreate, rel);
739 } 742 }
@@ -1041,6 +1044,7 @@ channel_confirm (struct MeshChannel *ch, int fwd)
1041 1044
1042 rel = fwd ? ch->root_rel : ch->dest_rel; 1045 rel = fwd ? ch->root_rel : ch->dest_rel;
1043 rel->client_ready = GNUNET_YES; 1046 rel->client_ready = GNUNET_YES;
1047 rel->expected_delay = rel->retry_timer;
1044 send_client_ack (ch, fwd); 1048 send_client_ack (ch, fwd);
1045 1049
1046 if (GNUNET_SCHEDULER_NO_TASK != rel->retry_task) 1050 if (GNUNET_SCHEDULER_NO_TASK != rel->retry_task)
@@ -1732,6 +1736,7 @@ GMCH_handle_local_create (struct MeshClient *c,
1732 /* In unreliable channels, we'll use the DLL to buffer BCK data */ 1736 /* In unreliable channels, we'll use the DLL to buffer BCK data */
1733 ch->root_rel = GNUNET_new (struct MeshChannelReliability); 1737 ch->root_rel = GNUNET_new (struct MeshChannelReliability);
1734 ch->root_rel->ch = ch; 1738 ch->root_rel->ch = ch;
1739 ch->root_rel->retry_timer = GNUNET_TIME_UNIT_SECONDS;
1735 ch->root_rel->expected_delay.rel_value_us = 0; 1740 ch->root_rel->expected_delay.rel_value_us = 0;
1736 1741
1737 LOG (GNUNET_ERROR_TYPE_DEBUG, "CREATED CHANNEL %s\n", GMCH_2s (ch)); 1742 LOG (GNUNET_ERROR_TYPE_DEBUG, "CREATED CHANNEL %s\n", GMCH_2s (ch));