/*
This file is part of GNUnet.
- Copyright (C) 2009-2013 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2009-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
enum GNUNET_BLOCK_Type type,
const struct GNUNET_HashCode *query,
const struct GNUNET_PeerIdentity *target,
- const char *bf_data, size_t bf_size,
+ const char *bf_data,
+ size_t bf_size,
uint32_t mingle,
uint32_t anonymity_level,
uint32_t priority,
if (NULL != target)
{
pr->public_data.target = (struct GNUNET_PeerIdentity *) eptr;
- memcpy (eptr, target, sizeof (struct GNUNET_PeerIdentity));
+ memcpy (eptr,
+ target,
+ sizeof (struct GNUNET_PeerIdentity));
}
pr->public_data.anonymity_level = anonymity_level;
pr->public_data.priority = priority;
UINT32_MAX,
GNUNET_TIME_UNIT_FOREVER_ABS,
GNUNET_TIME_UNIT_FOREVER_ABS,
- GNUNET_BLOCK_TYPE_ANY, NULL, 0);
+ GNUNET_BLOCK_TYPE_ANY,
+ NULL,
+ 0);
GSF_pending_request_cancel_ (dpr,
GNUNET_YES);
}
if (NULL != (cont = pr->llc_cont))
{
pr->llc_cont = NULL;
- cont (pr->llc_cont_cls, pr, pr->local_result);
+ cont (pr->llc_cont_cls,
+ pr,
+ pr->local_result);
}
GSF_plan_notify_request_done_ (pr);
GNUNET_free_non_null (pr->replies_seen);
&pr->public_data.query,
pr));
GNUNET_STATISTICS_update (GSF_stats,
- gettext_noop ("# Pending requests active"), -1,
+ gettext_noop ("# Pending requests active"),
+ -1,
GNUNET_NO);
GNUNET_free (pr);
return GNUNET_YES;
if (NULL == pr_map)
return; /* already cleaned up! */
- if (GNUNET_YES != full_cleanup)
+ if (GNUNET_NO == full_cleanup)
{
/* make request inactive (we're no longer interested in more results),
* but do NOT remove from our data-structures, we still need it there
/* retry -- without delay, as this is non-anonymous
and cadet/cadet connect will take some time anyway */
pr->cadet_request = GSF_cadet_query (pr->public_data.target,
- &pr->public_data.query,
- pr->public_data.type,
- &cadet_reply_proc,
- pr);
+ &pr->public_data.query,
+ pr->public_data.type,
+ &cadet_reply_proc,
+ pr);
return;
}
if (GNUNET_YES !=
if (NULL != pr->cadet_request)
return;
pr->cadet_request = GSF_cadet_query (pr->public_data.target,
- &pr->public_data.query,
- pr->public_data.type,
- &cadet_reply_proc,
- pr);
+ &pr->public_data.query,
+ pr->public_data.type,
+ &cadet_reply_proc,
+ pr);
}
* Task that issues a warning if the datastore lookup takes too long.
*
* @param cls the `struct GSF_PendingRequest`
- * @param tc task context
*/
static void
-warn_delay_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+warn_delay_task (void *cls)
{
struct GSF_PendingRequest *pr = cls;
* Task that issues a warning if the datastore lookup takes too long.
*
* @param cls the `struct GSF_PendingRequest`
- * @param tc task context
*/
static void
-odc_warn_delay_task (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+odc_warn_delay_task (void *cls)
{
struct GSF_PendingRequest *pr = cls;
}
+/**
+ * Check if the given request is still active.
+ *
+ * @param pr pending request
+ * @return #GNUNET_YES if the request is still active
+ */
+int
+GSF_pending_request_test_active_ (struct GSF_PendingRequest *pr)
+{
+ return (NULL != pr->rh) ? GNUNET_YES : GNUNET_NO;
+}
+
+
/**
* Setup the subsystem.
*/
void
GSF_pending_request_done_ ()
{
- GNUNET_CONTAINER_multihashmap_iterate (pr_map, &clean_request, NULL);
+ GNUNET_CONTAINER_multihashmap_iterate (pr_map,
+ &clean_request,
+ NULL);
GNUNET_CONTAINER_multihashmap_destroy (pr_map);
pr_map = NULL;
GNUNET_CONTAINER_heap_destroy (requests_by_expiration_heap);