/*
This file is part of GNUnet.
- (C) 2010,2011 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2010,2011 Christian Grothoff (and other contributing authors)
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
/**
* Current task performing the check.
*/
- GNUNET_SCHEDULER_TaskIdentifier task;
+ struct GNUNET_SCHEDULER_Task * task;
};
GNUNET_SERVER_notify_transmit_ready_cancel (bc->th);
bc->th = NULL;
}
- if (bc->task == GNUNET_SCHEDULER_NO_TASK)
+ if (bc->task == NULL)
bc->task = GNUNET_SCHEDULER_add_now (&do_blacklist_check, bc);
}
GNUNET_CONTAINER_DLL_remove (bl_head, bl_tail, bl);
bc->th = NULL;
if (size == 0)
{
- GNUNET_assert (bc->task == GNUNET_SCHEDULER_NO_TASK);
+ GNUNET_assert (bc->task == NULL);
bc->task = GNUNET_SCHEDULER_add_now (&do_blacklist_check, bc);
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"Failed to send blacklist test for peer `%s' to client\n",
struct GST_BlacklistCheck *bc = cls;
struct Blacklisters *bl;
- bc->task = GNUNET_SCHEDULER_NO_TASK;
+ bc->task = NULL;
bl = bc->bl_pos;
if (bl == NULL)
{
* blacklisting client.
*
* @param cls the `struct TestConnectionContext *`
- * @param peer neighbour's identity
+ * @param peer identity of the peer
* @param address the address
* @param state current state this peer is in
* @param state_timeout timeout for the current state of the peer
* @param bandwidth_out bandwidth assigned outbound
*/
static void
-test_connection_ok (void *cls, const struct GNUNET_PeerIdentity *peer,
- const struct GNUNET_HELLO_Address *address,
- enum GNUNET_TRANSPORT_PeerState state,
- struct GNUNET_TIME_Absolute state_timeout,
- struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
- struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
+test_connection_ok (void *cls,
+ const struct GNUNET_PeerIdentity *peer,
+ const struct GNUNET_HELLO_Address *address,
+ enum GNUNET_TRANSPORT_PeerState state,
+ struct GNUNET_TIME_Absolute state_timeout,
+ struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
+ struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
{
struct TestConnectionContext *tcc = cls;
struct GST_BlacklistCheck *bc;
bc = GNUNET_new (struct GST_BlacklistCheck);
- GNUNET_CONTAINER_DLL_insert(bc_head, bc_tail, bc);
+ GNUNET_CONTAINER_DLL_insert (bc_head,
+ bc_tail,
+ bc);
bc->peer = *peer;
bc->cont = &confirm_or_drop_neighbour;
bc->cont_cls = NULL;
}
/* check if any other blacklist checks are waiting for this blacklister */
for (bc = bc_head; bc != NULL; bc = bc->next)
- if ((bc->bl_pos == bl) && (GNUNET_SCHEDULER_NO_TASK == bc->task))
+ if ((bc->bl_pos == bl) && (NULL == bc->task))
{
bc->task = GNUNET_SCHEDULER_add_now (&do_blacklist_check, bc);
break;
bc->bl_pos->bc = NULL;
}
}
- if (GNUNET_SCHEDULER_NO_TASK != bc->task)
+ if (NULL != bc->task)
{
GNUNET_SCHEDULER_cancel (bc->task);
- bc->task = GNUNET_SCHEDULER_NO_TASK;
+ bc->task = NULL;
}
if (NULL != bc->th)
{