-/*
+/**
* This file is part of GNUnet
- * Copyright (C) 2013 Christian Grothoff (and other contributing authors)
+ * Copyright (C) 2013 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
* Task run during shutdown.
*
* @param cls unused
- * @param tc unused
*/
static void
-shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+shutdown_task (void *cls)
{
if (NULL != nc)
{
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Message get: invalid method prefix. size: %u < %u?\n",
- size, sizeof (*req) + 1);
+ size,
+ (unsigned int) (sizeof (*req) + 1));
GNUNET_break (0);
GNUNET_SERVER_receive_done (client, GNUNET_SYSERR);
return;
static void
recv_state_message_part (void *cls,
- const struct GNUNET_CRYPTO_EcdsaPublicKey *slave_key,
- uint64_t message_id, uint32_t flags, uint64_t data_offset,
- const struct GNUNET_MessageHeader *msg)
+ const struct GNUNET_PSYC_MessageHeader *msg,
+ const struct GNUNET_MessageHeader *pmsg)
{
struct StateModifyClosure *scls = cls;
uint16_t psize;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"recv_state_message_part() message_id: %" PRIu64
- ", data_offset: %" PRIu64 ", flags: %u\n",
- message_id, data_offset, flags);
+ ", fragment_offset: %" PRIu64 ", flags: %u\n",
+ GNUNET_ntohll (msg->message_id),
+ GNUNET_ntohll (msg->fragment_offset),
+ ntohl (msg->flags));
- if (NULL == msg)
+ if (NULL == pmsg)
{
scls->msg_state = GNUNET_PSYC_MESSAGE_STATE_ERROR;
return;
}
- switch (ntohs (msg->type))
+ switch (ntohs (pmsg->type))
{
case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_METHOD:
{
case GNUNET_MESSAGE_TYPE_PSYC_MESSAGE_MODIFIER:
{
struct GNUNET_PSYC_MessageModifier *
- pmod = (struct GNUNET_PSYC_MessageModifier *) msg;
+ pmod = (struct GNUNET_PSYC_MessageModifier *) pmsg;
psize = ntohs (pmod->header.size);
uint16_t name_size = ntohs (pmod->name_size);
uint32_t value_size = ntohl (pmod->value_size);
GNUNET_break_op (0);
scls->msg_state = GNUNET_PSYC_MESSAGE_STATE_ERROR;
}
- psize = ntohs (msg->size);
+ psize = ntohs (pmsg->size);
memcpy (scls->mod_value + (scls->mod_value_size - scls->mod_value_remaining),
- &msg[1], psize - sizeof (*msg));
- scls->mod_value_remaining -= psize - sizeof (*msg);
+ &pmsg[1], psize - sizeof (*pmsg));
+ scls->mod_value_remaining -= psize - sizeof (*pmsg);
if (0 == scls->mod_value_remaining)
{
db->state_modify_op (db->cls, &scls->channel_key,
GNUNET_CONFIGURATION_get_value_string (cfg, "psycstore", "database",
&database))
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "No database backend configured\n");
+ GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR,
+ "psycstore",
+ "database");
}
else
{
- GNUNET_asprintf (&db_lib_name, "libgnunet_plugin_psycstore_%s", database);
+ GNUNET_asprintf (&db_lib_name,
+ "libgnunet_plugin_psycstore_%s",
+ database);
db = GNUNET_PLUGIN_load (db_lib_name, (void *) cfg);
GNUNET_free (database);
}
stats = GNUNET_STATISTICS_create ("psycstore", cfg);
GNUNET_SERVER_add_handlers (server, handlers);
nc = GNUNET_SERVER_notification_context_create (server, 1);
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task,
- NULL);
+ GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
+ NULL);
}