/*
This file is part of GNUnet.
- (C) 2012, 2013 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2012, 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
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.
*/
/**
/**
* Task that is scheduled to asynchronously terminate the connection.
*/
- GNUNET_SCHEDULER_TaskIdentifier terminate_task;
+ struct GNUNET_SCHEDULER_Task * terminate_task;
/**
* Task that is scheduled to terminate idle connections.
*/
- GNUNET_SCHEDULER_TaskIdentifier timeout_task;
+ struct GNUNET_SCHEDULER_Task * timeout_task;
/**
* Size of the last write that was initiated.
* Task run to asynchronously terminate the cadet due to timeout.
*
* @param cls the 'struct CadetClient'
- * @param tc scheduler context
*/
static void
-timeout_cadet_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+timeout_cadet_task (void *cls)
{
struct CadetClient *sc = cls;
struct GNUNET_CADET_Channel *tun;
- sc->timeout_task = GNUNET_SCHEDULER_NO_TASK;
+ sc->timeout_task = NULL;
tun = sc->channel;
sc->channel = NULL;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
static void
refresh_timeout_task (struct CadetClient *sc)
{
- if (GNUNET_SCHEDULER_NO_TASK != sc->timeout_task)
+ if (NULL != sc->timeout_task)
GNUNET_SCHEDULER_cancel (sc->timeout_task);
sc->timeout_task = GNUNET_SCHEDULER_add_delayed (IDLE_TIMEOUT,
&timeout_cadet_task,
static void
handle_datastore_reply (void *cls,
const struct GNUNET_HashCode *key,
- size_t size, const void *data,
+ size_t size,
+ const void *data,
enum GNUNET_BLOCK_Type type,
uint32_t priority,
uint32_t anonymity,
hard error as we might have had the answer in the
past and the user might have unindexed it. Hence
we log at level "INFO" for now. */
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Have no answer for query `%s'\n",
- GNUNET_h2s (key));
+ if (NULL == key)
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Have no answer and the query was NULL\n");
+ }
+ else
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Have no answer for query `%s'\n",
+ GNUNET_h2s (key));
+ }
GNUNET_STATISTICS_update (GSF_stats,
- gettext_noop ("# queries received via cadet not answered"), 1,
+ gettext_noop ("# queries received via CADET not answered"), 1,
GNUNET_NO);
continue_writing (sc);
return;
* Functions with this signature are called whenever a
* complete query message is received.
*
- * Do not call #GNUNET_SERVER_mst_destroy in callback
+ * Do not call #GNUNET_SERVER_mst_destroy() in callback
*
- * @param cls closure with the 'struct CadetClient'
+ * @param cls closure with the `struct CadetClient`
* @param channel channel handle
* @param channel_ctx channel context
* @param message the actual message
ntohl (sqm->type),
0 /* priority */,
GSF_datastore_queue_size,
- GNUNET_TIME_UNIT_FOREVER_REL,
&handle_datastore_reply, sc);
if (NULL == sc->qe)
{
GNUNET_STATISTICS_update (GSF_stats,
gettext_noop ("# cadet connections active"), -1,
GNUNET_NO);
- if (GNUNET_SCHEDULER_NO_TASK != sc->terminate_task)
+ if (NULL != sc->terminate_task)
GNUNET_SCHEDULER_cancel (sc->terminate_task);
- if (GNUNET_SCHEDULER_NO_TASK != sc->timeout_task)
+ if (NULL != sc->timeout_task)
GNUNET_SCHEDULER_cancel (sc->timeout_task);
if (NULL != sc->wh)
GNUNET_CADET_notify_transmit_ready_cancel (sc->wh);