From: Christian Grothoff Date: Wed, 27 Jul 2011 07:32:32 +0000 (+0000) Subject: fix X-Git-Tag: initial-import-from-subversion-38251~17608 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=22dafb003418aab11e036230b3761116c397d239;p=oweals%2Fgnunet.git fix --- 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; }