/*
This file is part of GNUnet.
- (C) 2009-2013 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2009-2013 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
* @author Christian Grothoff
* @author Nathan Evans
*/
-
#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_block_lib.h"
/**
* Task for scheduling preference updates
*/
- GNUNET_SCHEDULER_TaskIdentifier preference_task;
+ struct GNUNET_SCHEDULER_Task * preference_task;
/**
* What is the identity of the peer?
/**
* Task that sends FIND PEER requests.
*/
-static GNUNET_SCHEDULER_TaskIdentifier find_peer_task;
+static struct GNUNET_SCHEDULER_Task * find_peer_task;
/**
* Identity of this peer.
int bucket;
struct GNUNET_HashCode phash;
- peer->preference_task = GNUNET_SCHEDULER_NO_TASK;
+ peer->preference_task = NULL;
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
GNUNET_CRYPTO_hash (&peer->id,
struct BloomConstructorContext bcc;
struct GNUNET_CONTAINER_BloomFilter *peer_bf;
- find_peer_task = GNUNET_SCHEDULER_NO_TASK;
+ find_peer_task = NULL;
if ((tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN) != 0)
return;
if (newly_found_peers > bucket_size)
GNUNET_CONTAINER_multipeermap_remove (all_known_peers,
peer,
to_remove));
- if (GNUNET_SCHEDULER_NO_TASK != to_remove->preference_task)
+ if (NULL != to_remove->preference_task)
{
GNUNET_SCHEDULER_cancel (to_remove->preference_task);
- to_remove->preference_task = GNUNET_SCHEDULER_NO_TASK;
+ to_remove->preference_task = NULL;
}
GNUNET_CRYPTO_hash (peer,
sizeof (struct GNUNET_PeerIdentity),
while ((NULL != (pending = peer->head)) &&
(0 == GNUNET_TIME_absolute_get_remaining (pending->timeout).rel_value_us))
{
+ GNUNET_STATISTICS_update (GDS_stats,
+ gettext_noop
+ ("# Messages dropped (CORE timeout)"),
+ 1,
+ GNUNET_NO);
peer->pending_count--;
GNUNET_CONTAINER_DLL_remove (peer->head, peer->tail, pending);
GNUNET_free (pending);
msize =
put_path_length * sizeof (struct GNUNET_PeerIdentity) + data_size +
sizeof (struct PeerPutMessage);
- if (msize >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
+ if (msize >= GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE)
{
put_path_length = 0;
msize = data_size + sizeof (struct PeerPutMessage);
}
- if (msize >= GNUNET_SERVER_MAX_MESSAGE_SIZE)
+ if (msize >= GNUNET_CONSTANTS_MAX_ENCRYPTED_MESSAGE_SIZE)
{
GNUNET_break (0);
GNUNET_free (targets);
{
switch (GNUNET_BLOCK_evaluate (GDS_block_context,
ntohl (put->type),
+ GNUNET_BLOCK_EO_NONE,
NULL, /* query */
NULL, 0, /* bloom filer */
NULL, 0, /* xquery */
GNUNET_CONTAINER_bloomfilter_init (&xquery[xquery_size], reply_bf_size,
GNUNET_CONSTANTS_BLOOMFILTER_K);
eval =
- GNUNET_BLOCK_evaluate (GDS_block_context, type, &get->key, &reply_bf,
- get->bf_mutator, xquery, xquery_size, NULL, 0);
+ GNUNET_BLOCK_evaluate (GDS_block_context,
+ type,
+ GNUNET_BLOCK_EO_NONE,
+ &get->key,
+ &reply_bf,
+ get->bf_mutator,
+ xquery,
+ xquery_size,
+ NULL,
+ 0);
if (eval != GNUNET_BLOCK_EVALUATION_REQUEST_VALID)
{
/* request invalid or block type not supported */
GNUNET_assert (0 == GNUNET_CONTAINER_multipeermap_size (all_known_peers));
GNUNET_CONTAINER_multipeermap_destroy (all_known_peers);
all_known_peers = NULL;
- if (GNUNET_SCHEDULER_NO_TASK != find_peer_task)
+ if (NULL != find_peer_task)
{
GNUNET_SCHEDULER_cancel (find_peer_task);
- find_peer_task = GNUNET_SCHEDULER_NO_TASK;
+ find_peer_task = NULL;
}
}