/*
This file is part of GNUnet.
- (C) 2011 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2011 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
*/
/**
/**
* ID of task that collects blocks for migration.
*/
-static GNUNET_SCHEDULER_TaskIdentifier mig_task;
+static struct GNUNET_SCHEDULER_Task * mig_task;
/**
* What is the maximum frequency at which we are allowed to
}
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Asking for transmission of %u bytes to %s for migration\n",
- msize,
+ (unsigned int) msize,
GNUNET_i2s (GSF_connected_peer_get_identity2_(peer->peer)));
peer->th = GSF_peer_transmit_ (peer->peer,
GNUNET_NO, 0 /* priority */ ,
* migration
*
* @param cls unused
- * @param tc scheduler context (also unused)
*/
static void
-gather_migration_blocks (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+gather_migration_blocks (void *cls);
/**
return;
if (NULL != mig_qe)
return;
- if (GNUNET_SCHEDULER_NO_TASK != mig_task)
+ if (NULL != mig_task)
return;
if (mig_size >= MAX_MIGRATION_QUEUE)
return;
* migration
*
* @param cls unused
- * @param tc scheduler context (also unused)
*/
static void
-gather_migration_blocks (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+gather_migration_blocks (void *cls)
{
- mig_task = GNUNET_SCHEDULER_NO_TASK;
+ mig_task = NULL;
if (mig_size >= MAX_MIGRATION_QUEUE)
return;
if (NULL == GSF_dsh)
if (GNUNET_YES != enabled)
return;
+ for (mrp = peer_head; NULL != mrp; mrp = mrp->next)
+ if (mrp->peer == peer)
+ break;
+ if (NULL != mrp)
+ {
+ /* same peer added twice, must not happen */
+ GNUNET_break (0);
+ return;
+ }
+
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Adding peer %s to list for pushing\n",
GNUNET_i2s (GSF_connected_peer_get_identity2_(peer)));
void
GSF_push_done_ ()
{
- if (GNUNET_SCHEDULER_NO_TASK != mig_task)
+ if (NULL != mig_task)
{
GNUNET_SCHEDULER_cancel (mig_task);
- mig_task = GNUNET_SCHEDULER_NO_TASK;
+ mig_task = NULL;
}
if (NULL != mig_qe)
{