* Sampler.
*/
typedef void
-(*RPS_get_peers_type) (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+(*RPS_get_peers_type) (void *cls);
/**
* Get one random peer out of the sampled peers.
* Only used internally
*/
static void
-sampler_get_rand_peer (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+sampler_get_rand_peer (void *cls);
+
/**
* Get one random peer out of the sampled peers.
* corrsponding peer to the client.
*/
static void
-sampler_mod_get_rand_peer (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc);
+sampler_mod_get_rand_peer (void *cls);
/**
"-%" PRIu32 ": %s",
i,
sampler->sampler_elements[i]->file_name);
+ GNUNET_free (sampler->sampler_elements[i]);
}
GNUNET_array_grow (sampler->sampler_elements,
* Only used internally
*/
static void
-sampler_get_rand_peer (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+sampler_get_rand_peer (void *cls)
{
struct GetPeerCls *gpc = cls;
uint32_t r_index;
struct RPS_Sampler *sampler;
gpc->get_peer_task = NULL;
- if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
- return;
sampler = gpc->req_handle->sampler;
/**;
* corrsponding peer to the client.
*/
static void
-sampler_mod_get_rand_peer (void *cls,
- const struct GNUNET_SCHEDULER_TaskContext *tc)
+sampler_mod_get_rand_peer (void *cls)
{
struct GetPeerCls *gpc = cls;
struct RPS_SamplerElement *s_elem;
struct RPS_Sampler *sampler;
gpc->get_peer_task = NULL;
- if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN))
- return;
sampler = gpc->req_handle->sampler;
LOG (GNUNET_ERROR_TYPE_DEBUG, "Single peer was requested\n");
if (EMPTY == s_elem->is_empty)
{
- LOG (GNUNET_ERROR_TYPE_DEBUG, "Sampler_mod element empty, rescheduling.\n");
+ LOG (GNUNET_ERROR_TYPE_DEBUG,
+ "Sampler_mod element empty, rescheduling.\n");
GNUNET_assert (NULL == gpc->get_peer_task);
gpc->get_peer_task =
GNUNET_SCHEDULER_add_delayed (sampler->max_round_interval,
req_handle->gpc_tail,
gpc);
// maybe add a little delay
- gpc->get_peer_task = GNUNET_SCHEDULER_add_now (sampler->get_peers, gpc);
+ gpc->get_peer_task = GNUNET_SCHEDULER_add_now (sampler->get_peers,
+ gpc);
}
return req_handle;
}