{
if (i < *list_size -1)
{ /* Not at the last entry -- shift peers left */
- GNUNET_memcpy (&tmp[i], &tmp[i +1],
+ memmove (&tmp[i], &tmp[i +1],
((*list_size) - i -1) * sizeof (struct GNUNET_PeerIdentity));
}
/* Remove last entry (should be now useless PeerID) */
cli_ctx = rep_cls->cli_ctx;
GNUNET_assert (NULL != cli_ctx);
- RPS_sampler_request_cancel (rep_cls->req_handle);
+ if (NULL != rep_cls->req_handle)
+ {
+ RPS_sampler_request_cancel (rep_cls->req_handle);
+ }
GNUNET_CONTAINER_DLL_remove (cli_ctx->rep_cls_head,
cli_ctx->rep_cls_tail,
rep_cls);
cli_ctx = reply_cls->cli_ctx;
GNUNET_assert (NULL != cli_ctx);
+ reply_cls->req_handle = NULL;
destroy_reply_cls (reply_cls);
GNUNET_MQ_send (cli_ctx->mq, ev);
}
////GNUNET_free (peers);
- GNUNET_SERVICE_client_drop (cli_ctx->client);
+ GNUNET_SERVICE_client_continue (cli_ctx->client);
}
/**
* via multiplying round_interval with a 'fraction' (0 to value)/value
*/
rand_delay = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, max_rand_delay);
- ret = GNUNET_TIME_relative_multiply (mean, rand_delay);
+ ret = GNUNET_TIME_relative_saturating_multiply (mean, rand_delay);
ret = GNUNET_TIME_relative_divide (ret, max_rand_delay);
ret = GNUNET_TIME_relative_add (ret, half_interval);
*/
static void
client_disconnect_cb (void *cls,
- struct GNUNET_SERVICE_Client *client,
- void *internal_cls)
+ struct GNUNET_SERVICE_Client *client,
+ void *internal_cls)
{
struct ClientContext *cli_ctx = internal_cls;
struct GNUNET_TIME_Relative half_round_interval;
struct GNUNET_TIME_Relative max_round_interval;
- half_round_interval = GNUNET_TIME_relative_multiply (round_interval, .5);
+ half_round_interval = GNUNET_TIME_relative_divide (round_interval, 2);
max_round_interval = GNUNET_TIME_relative_add (round_interval, half_round_interval);
prot_sampler = RPS_sampler_init (sampler_size_est_need, max_round_interval);