diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-01-02 01:22:04 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-01-02 01:22:04 +0100 |
commit | 18a677a335becdb59d22cc60a04253268ed2ecd6 (patch) | |
tree | 4e474339f8479c389b66a72407bafb76093fa7f8 /src/cadet/gnunet-service-cadet_core.c | |
parent | 04ff2b8f3b3b499e56a878b2d9166f03f7610784 (diff) | |
download | gnunet-18a677a335becdb59d22cc60a04253268ed2ecd6.tar.gz gnunet-18a677a335becdb59d22cc60a04253268ed2ecd6.zip |
fix issue with sending BROKEN timeouts early due to wrong timeout calculation
Diffstat (limited to 'src/cadet/gnunet-service-cadet_core.c')
-rw-r--r-- | src/cadet/gnunet-service-cadet_core.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cadet/gnunet-service-cadet_core.c b/src/cadet/gnunet-service-cadet_core.c index 99957d8a1..84aff1857 100644 --- a/src/cadet/gnunet-service-cadet_core.c +++ b/src/cadet/gnunet-service-cadet_core.c | |||
@@ -623,7 +623,7 @@ timeout_cb (void *cls) | |||
623 | { | 623 | { |
624 | exp = GNUNET_TIME_absolute_add (r->last_use, | 624 | exp = GNUNET_TIME_absolute_add (r->last_use, |
625 | linger); | 625 | linger); |
626 | if (0 != GNUNET_TIME_absolute_get_duration (exp).rel_value_us) | 626 | if (0 != GNUNET_TIME_absolute_get_remaining (exp).rel_value_us) |
627 | { | 627 | { |
628 | /* Route not yet timed out, wait until it does. */ | 628 | /* Route not yet timed out, wait until it does. */ |
629 | timeout_task = GNUNET_SCHEDULER_add_at (exp, | 629 | timeout_task = GNUNET_SCHEDULER_add_at (exp, |
@@ -631,6 +631,11 @@ timeout_cb (void *cls) | |||
631 | NULL); | 631 | NULL); |
632 | return; | 632 | return; |
633 | } | 633 | } |
634 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
635 | "Sending BROKEN due to timeout (%s was last use, %s linger)\n", | ||
636 | GNUNET_STRINGS_absolute_time_to_string (r->last_use), | ||
637 | GNUNET_STRINGS_relative_time_to_string (linger, | ||
638 | GNUNET_YES)); | ||
634 | send_broken (&r->prev, | 639 | send_broken (&r->prev, |
635 | &r->cid, | 640 | &r->cid, |
636 | NULL, | 641 | NULL, |
@@ -688,6 +693,8 @@ dir_ready_cb (void *cls, | |||
688 | return; | 693 | return; |
689 | } | 694 | } |
690 | odir = (dir == &route->next) ? &route->prev : &route->next; | 695 | odir = (dir == &route->next) ? &route->prev : &route->next; |
696 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | ||
697 | "Sending BROKEN due to MQ going down\n"); | ||
691 | send_broken (&route->next, | 698 | send_broken (&route->next, |
692 | &route->cid, | 699 | &route->cid, |
693 | GCP_get_id (odir->hop), | 700 | GCP_get_id (odir->hop), |