/*
This file is part of GNUnet.
- (C) 2009, 2010, 2011 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2009, 2010, 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.
*/
/**
reply);
memcpy (&cbuf[off], reply->msg, msize);
GNUNET_free (reply);
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmitting %u bytes to client %p\n",
- msize, client->client_handle);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Transmitting %u bytes to client %p\n",
+ (unsigned int) msize,
+ client->client_handle);
off += msize;
}
process_pending_messages (client);
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmitted %u/%u bytes to client %p\n",
- (unsigned int) off, (unsigned int) size, client->client_handle);
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Transmitted %u/%u bytes to client %p\n",
+ (unsigned int) off,
+ (unsigned int) size,
+ client->client_handle);
return off;
}
int do_free;
struct GNUNET_HashCode ch;
unsigned int i;
-
+
LOG_TRAFFIC (GNUNET_ERROR_TYPE_DEBUG,
"XVINE CLIENT-RESULT %s\n",
GNUNET_h2s_full (key));
return GNUNET_YES; /* duplicate */
}
eval =
- GNUNET_BLOCK_evaluate (GDS_block_context, record->type, key, NULL, 0,
- record->xquery, record->xquery_size, frc->data,
+ GNUNET_BLOCK_evaluate (GDS_block_context,
+ record->type,
+ GNUNET_BLOCK_EO_NONE,
+ key, NULL, 0,
+ record->xquery,
+ record->xquery_size,
+ frc->data,
frc->data_size);
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Evaluation result is %d for key %s for local client's query\n",
/**
- * Route the given request via the DHT.
+ * Route the given request via the DHT.
*/
static void
transmit_request (struct ClientQueryRecord *cqr)
gettext_noop
("# GET requests from clients injected"), 1,
GNUNET_NO);
-
+
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Initiating GET for %s, replication %u, already have %u replies\n",
GNUNET_h2s (&cqr->key),
cqr->replication,
cqr->seen_replies_count);
-
- GDS_NEIGHBOURS_handle_get (&cqr->key, cqr->type, cqr->msg_options,
+
+ GDS_NEIGHBOURS_handle_get (&cqr->key, cqr->type, cqr->msg_options,
cqr->replication);
-
+
/* exponential back-off for retries.
* max GNUNET_TIME_STD_EXPONENTIAL_BACKOFF_THRESHOLD (15 min) */
cqr->retry_frequency = GNUNET_TIME_STD_BACKOFF (cqr->retry_frequency);
* itself (unless the heap is empty).
*
* @param cls unused
- * @param tc scheduler context
*/
static void
-transmit_next_request_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+transmit_next_request_task (void *cls)
{
struct ClientQueryRecord *cqr;
struct GNUNET_TIME_Relative delay;
retry_task = NULL;
- if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
- return;
while (NULL != (cqr = GNUNET_CONTAINER_heap_remove_root (retry_heap)))
{
cqr->hnode = NULL;
ntohl (put_msg->type),
size - sizeof (struct GNUNET_DHT_ClientPutMessage),
&put_msg[1]);
-
- GDS_NEIGHBOURS_handle_put (&put_msg->key,
+
+ GDS_NEIGHBOURS_handle_put (&put_msg->key,
ntohl (put_msg->type), ntohl (put_msg->options),
ntohl (put_msg->desired_replication_level),
GNUNET_TIME_absolute_ntoh (put_msg->expiration),
cqr->replication = ntohl (get->desired_replication_level);
cqr->msg_options = ntohl (get->options);
cqr->type = ntohl (get->type);
-
+
// FIXME use cqr->key, set multihashmap create to GNUNET_YES
GNUNET_CONTAINER_multihashmap_put (forward_map, &get->key, cqr,
GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE);
-
+
struct GNUNET_PeerIdentity my_identity;
my_identity = GDS_NEIGHBOURS_get_my_id();
GDS_CLIENTS_process_get (ntohl (get->options),
msg = (const struct GNUNET_DHT_ActMaliciousMessage *)message;
malicious_action = msg->action;
-
+
if(GNUNET_OK == GDS_NEIGHBOURS_act_malicious (malicious_action))
{
pm = GNUNET_malloc (sizeof (struct PendingMessage) +