if (NULL == t->kx_task)
{
t->kx_task
- = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining (t->next_kx_attempt),
- &retry_kx,
- t);
+ = GNUNET_SCHEDULER_add_at (t->next_kx_attempt,
+ &retry_kx,
+ t);
}
break;
case CADET_TUNNEL_KEY_OK:
/**
* Key exchange state for this peer.
- */
+ */
struct GSC_KeyExchangeInfo *kx;
-
+
/**
* Head of list of requests from clients for transmission to
* this peer.
GNUNET_YES));
if (NULL != session->cork_task)
GNUNET_SCHEDULER_cancel (session->cork_task);
- session->cork_task =
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining (min_deadline),
- &pop_cork_task,
- session);
+ session->cork_task
+ = GNUNET_SCHEDULER_add_at (min_deadline,
+ &pop_cork_task,
+ session);
}
else
{
delay = GNUNET_TIME_absolute_get_remaining (cqr->retry_time);
if (delay.rel_value_us > 0)
{
- cqr->hnode =
- GNUNET_CONTAINER_heap_insert (retry_heap,
+ cqr->hnode
+ = GNUNET_CONTAINER_heap_insert (retry_heap,
cqr,
cqr->retry_time.abs_value_us);
- retry_task =
- GNUNET_SCHEDULER_add_delayed (delay,
- &transmit_next_request_task,
- NULL);
+ retry_task
+ = GNUNET_SCHEDULER_add_at (cqr->retry_time,
+ &transmit_next_request_task,
+ NULL);
return;
}
transmit_request (cqr);
cqr->hnode
- = GNUNET_CONTAINER_heap_insert (retry_heap, cqr,
+ = GNUNET_CONTAINER_heap_insert (retry_heap,
+ cqr,
cqr->retry_time.abs_value_us);
}
}
fc->proc_busy = GNUNET_NO;
GNUNET_assert (fc->task == NULL);
fc->task =
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining
- (fc->delay_until), &transmit_next, fc);
+ GNUNET_SCHEDULER_add_at (fc->delay_until,
+ &transmit_next,
+ fc);
}
gettext_noop ("# delay heap timeout (ms)"),
delay.rel_value_us / 1000LL, GNUNET_NO);
- pp->task =
- GNUNET_SCHEDULER_add_delayed (delay,
- &schedule_peer_transmission,
- pp);
+ pp->task
+ = GNUNET_SCHEDULER_add_at (rp->earliest_transmission,
+ &schedule_peer_transmission,
+ pp);
return;
}
#if INSANE_STATISTICS
GNUNET_notification_context_add (nc,
mq);
setup_estimate_message (&em);
- env = GNUNET_MQ_msg_copy (&em.header);
+ env = GNUNET_MQ_msg_copy (&em.header);
GNUNET_MQ_send (mq,
env);
GNUNET_SERVICE_client_continue (client);
struct NSEPeerEntry *peer_entry = cls;
unsigned int idx;
struct GNUNET_MQ_Envelope *env;
-
+
peer_entry->transmit_task = NULL;
idx = estimate_index;
if (GNUNET_NO == peer_entry->previous_round)
{
idx = (idx + HISTORY_SIZE - 1) % HISTORY_SIZE;
peer_entry->previous_round = GNUNET_YES;
- peer_entry->transmit_task
+ peer_entry->transmit_task
= GNUNET_SCHEDULER_add_delayed (get_transmit_delay (0),
&transmit_task_cb,
peer_entry);
GNUNET_NO);
#if ENABLE_NSE_HISTOGRAM
peer_entry->transmitted_messages++;
- peer_entry->last_transmitted_size
+ peer_entry->last_transmitted_size
= ntohl(size_estimate_messages[idx].matching_bits);
#endif
env = GNUNET_MQ_msg_copy (&size_estimate_messages[idx].header);
GNUNET_MQ_send (peer_entry->mq,
- env);
+ env);
}
GNUNET_CONTAINER_multipeermap_iterate (peers,
&schedule_current_round,
NULL);
- flood_task =
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining
- (next_timestamp),
- &update_flood_message,
- NULL);
+ flood_task
+ = GNUNET_SCHEDULER_add_at (next_timestamp,
+ &update_flood_message,
+ NULL);
}
{
/* still stuck in previous round, no point to update, check that
* we are active here though... */
- if (NULL == peer_entry->transmit_task)
+ if (NULL == peer_entry->transmit_task)
{
GNUNET_break (0);
}
/**
* Core handler for size estimate flooding messages.
*
- * @param cls peer this message is from
+ * @param cls peer this message is from
* @param incoming_flood received message
*/
static void
/* push back our result now, that peer is spreading bad information... */
if (NULL != peer_entry->transmit_task)
GNUNET_SCHEDULER_cancel (peer_entry->transmit_task);
- peer_entry->transmit_task
+ peer_entry->transmit_task
= GNUNET_SCHEDULER_add_now (&transmit_task_cb,
peer_entry);
/* Not closer than our most recent message, no need to do work here */
current_timestamp);
estimate_count++;
}
- flood_task =
- GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining
- (next_timestamp),
- &update_flood_message,
- NULL);
+ flood_task
+ = GNUNET_SCHEDULER_add_at (next_timestamp,
+ &update_flood_message,
+ NULL);
}
1,
GNUNET_NO);
/* prepare to send the next one */
- if (NULL != pl->hello_delay_task)
- GNUNET_SCHEDULER_cancel (pl->hello_delay_task);
pl->next_hello_allowed
= GNUNET_TIME_relative_to_absolute (HELLO_ADVERTISEMENT_MIN_FREQUENCY);
+ if (NULL != pl->hello_delay_task)
+ GNUNET_SCHEDULER_cancel (pl->hello_delay_task);
pl->hello_delay_task
= GNUNET_SCHEDULER_add_now (&schedule_next_hello,
pl);
const struct GNUNET_HELLO_Message *message)
{
struct GNUNET_PeerIdentity pid;
-
+
if (GNUNET_OK !=
GNUNET_HELLO_get_id (message,
&pid))
struct DelayQueueEntry *dqe = cls;
struct DelayQueueEntry *next;
struct TM_Peer *tmp = dqe->tmp;
- struct GNUNET_TIME_Relative delay;
GNUNET_break (GNUNET_YES ==
GST_neighbours_test_connected (&dqe->id));
if (NULL != next)
{
/* More delayed messages */
- delay = GNUNET_TIME_absolute_get_remaining(next->sent_at);
- tmp->send_delay_task = GNUNET_SCHEDULER_add_delayed(delay,
- &send_delayed, next);
+ tmp->send_delay_task = GNUNET_SCHEDULER_add_at (next->sent_at,
+ &send_delayed,
+ next);
}
}
else
if (NULL != next)
{
/* More delayed messages */
- delay = GNUNET_TIME_absolute_get_remaining(next->sent_at);
- generic_send_delay_task = GNUNET_SCHEDULER_add_delayed (delay,
- &send_delayed,
- next);
+ generic_send_delay_task = GNUNET_SCHEDULER_add_at (next->sent_at,
+ &send_delayed,
+ next);
}
}
GST_neighbours_send (&dqe->id,
generic_send_delay_task = NULL;
if (NULL != generic_dqe_head)
generic_send_delay_task
- = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining(generic_dqe_head->sent_at),
- &send_delayed,
- generic_dqe_head);
+ = GNUNET_SCHEDULER_add_at (generic_dqe_head->sent_at,
+ &send_delayed,
+ generic_dqe_head);
}
}
{
/* new timeout is earlier, reschedule master task */
GNUNET_SCHEDULER_cancel (n->task);
- n->task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining (timeout),
- &master_task,
- n);
+ n->task = GNUNET_SCHEDULER_add_at (timeout,
+ &master_task,
+ n);
}
n->timeout = timeout;
GNUNET_log (GNUNET_ERROR_TYPE_INFO,