diff options
author | Bart Polot <bart@net.in.tum.de> | 2014-07-02 19:30:48 +0000 |
---|---|---|
committer | Bart Polot <bart@net.in.tum.de> | 2014-07-02 19:30:48 +0000 |
commit | aa5aa465cd62446736d19d48d6cf653f00822fd0 (patch) | |
tree | 0f85b6efe12b98d5ce8c57d013175c273f8d98f8 /src/cadet | |
parent | 26d3e4b2e9f2431c50100228d86d2cbd939cf31a (diff) | |
download | gnunet-aa5aa465cd62446736d19d48d6cf653f00822fd0.tar.gz gnunet-aa5aa465cd62446736d19d48d6cf653f00822fd0.zip |
- fix #3479
Diffstat (limited to 'src/cadet')
-rw-r--r-- | src/cadet/gnunet-service-cadet_tunnel.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/cadet/gnunet-service-cadet_tunnel.c b/src/cadet/gnunet-service-cadet_tunnel.c index 72e4cf6ff..71b859665 100644 --- a/src/cadet/gnunet-service-cadet_tunnel.c +++ b/src/cadet/gnunet-service-cadet_tunnel.c | |||
@@ -1350,6 +1350,12 @@ rekey_tunnel (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1350 | { | 1350 | { |
1351 | struct GNUNET_TIME_Relative duration; | 1351 | struct GNUNET_TIME_Relative duration; |
1352 | 1352 | ||
1353 | if (GNUNET_SCHEDULER_NO_TASK != t->kx_ctx->finish_task) | ||
1354 | { | ||
1355 | GNUNET_SCHEDULER_cancel (t->kx_ctx->finish_task); | ||
1356 | t->kx_ctx->finish_task = GNUNET_SCHEDULER_NO_TASK; | ||
1357 | } | ||
1358 | |||
1353 | duration = GNUNET_TIME_absolute_get_duration (t->kx_ctx->rekey_start_time); | 1359 | duration = GNUNET_TIME_absolute_get_duration (t->kx_ctx->rekey_start_time); |
1354 | LOG (GNUNET_ERROR_TYPE_DEBUG, " kx started %s ago\n", | 1360 | LOG (GNUNET_ERROR_TYPE_DEBUG, " kx started %s ago\n", |
1355 | GNUNET_STRINGS_relative_time_to_string (duration, GNUNET_YES)); | 1361 | GNUNET_STRINGS_relative_time_to_string (duration, GNUNET_YES)); |
@@ -1770,7 +1776,14 @@ handle_ephemeral (struct CadetTunnel *t, | |||
1770 | } | 1776 | } |
1771 | 1777 | ||
1772 | if (NULL == t->kx_ctx) | 1778 | if (NULL == t->kx_ctx) |
1779 | { | ||
1773 | create_kx_ctx (t); | 1780 | create_kx_ctx (t); |
1781 | } | ||
1782 | else if (GNUNET_SCHEDULER_NO_TASK != t->kx_ctx->finish_task) | ||
1783 | { | ||
1784 | GNUNET_SCHEDULER_cancel (t->kx_ctx->finish_task); | ||
1785 | t->kx_ctx->finish_task = GNUNET_SCHEDULER_NO_TASK; | ||
1786 | } | ||
1774 | if (0 != memcmp (&t->peers_ephemeral_key, &msg->ephemeral_key, | 1787 | if (0 != memcmp (&t->peers_ephemeral_key, &msg->ephemeral_key, |
1775 | sizeof (msg->ephemeral_key))) | 1788 | sizeof (msg->ephemeral_key))) |
1776 | { | 1789 | { |
@@ -1820,7 +1833,14 @@ handle_ping (struct CadetTunnel *t, | |||
1820 | LOG (GNUNET_ERROR_TYPE_DEBUG, " got %u\n", res.nonce); | 1833 | LOG (GNUNET_ERROR_TYPE_DEBUG, " got %u\n", res.nonce); |
1821 | LOG (GNUNET_ERROR_TYPE_DEBUG, " towards %s\n", GNUNET_i2s (&res.target)); | 1834 | LOG (GNUNET_ERROR_TYPE_DEBUG, " towards %s\n", GNUNET_i2s (&res.target)); |
1822 | if (NULL == t->kx_ctx) | 1835 | if (NULL == t->kx_ctx) |
1836 | { | ||
1823 | create_kx_ctx (t); | 1837 | create_kx_ctx (t); |
1838 | } | ||
1839 | else if (GNUNET_SCHEDULER_NO_TASK != t->kx_ctx->finish_task) | ||
1840 | { | ||
1841 | GNUNET_SCHEDULER_cancel (t->kx_ctx->finish_task); | ||
1842 | t->kx_ctx->finish_task = GNUNET_SCHEDULER_NO_TASK; | ||
1843 | } | ||
1824 | send_ephemeral (t); | 1844 | send_ephemeral (t); |
1825 | send_ping (t); | 1845 | send_ping (t); |
1826 | return; | 1846 | return; |