From 22dafb003418aab11e036230b3761116c397d239 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 27 Jul 2011 07:32:32 +0000 Subject: [PATCH] fix --- src/fragmentation/fragmentation.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/fragmentation/fragmentation.c b/src/fragmentation/fragmentation.c index 71a84225c..77b4c2e49 100644 --- a/src/fragmentation/fragmentation.c +++ b/src/fragmentation/fragmentation.c @@ -347,10 +347,19 @@ GNUNET_FRAGMENT_process_ack (struct GNUNET_FRAGMENT_Context *fc, if (0 != fc->acks) { /* more to transmit, do so right now (if tracker permits...) */ - GNUNET_assert(fc->task != GNUNET_SCHEDULER_NO_TASK); - GNUNET_SCHEDULER_cancel (fc->task); - fc->task = GNUNET_SCHEDULER_add_now (&transmit_next, - fc); + if (fc->task != GNUNET_SCHEDULER_NO_TASK) + { + /* schedule next transmission now, no point in waiting... */ + GNUNET_SCHEDULER_cancel (fc->task); + fc->task = GNUNET_SCHEDULER_add_now (&transmit_next, + fc); + } + else + { + /* only case where there is no task should be if we're waiting + for the right to transmit again (proc_busy set to YES) */ + GNUNET_assert (GNUNET_YES == fc->proc_busy); + } return GNUNET_NO; } -- 2.25.1