struct Scheduled *scheduled_tail;
/**
- * the time until the select driver will wake up again (after
+ * the time when the select driver will wake up again (after
* calling select)
*/
- struct GNUNET_TIME_Relative timeout;
+ struct GNUNET_TIME_Absolute timeout;
};
struct GNUNET_SCHEDULER_Driver *driver;
struct DriverContext context = {.scheduled_head = NULL,
.scheduled_tail = NULL,
- .timeout = GNUNET_TIME_UNIT_FOREVER_REL};
+ .timeout = GNUNET_TIME_UNIT_FOREVER_ABS};
driver = GNUNET_SCHEDULER_driver_select ();
driver->cls = &context;
ws = GNUNET_NETWORK_fdset_create ();
tasks_ready = GNUNET_NO;
while (NULL != context->scheduled_head ||
- GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us != context->timeout.rel_value_us)
+ GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us != context->timeout.abs_value_us)
{
LOG (GNUNET_ERROR_TYPE_DEBUG,
"select timeout = %s\n",
- GNUNET_STRINGS_relative_time_to_string (context->timeout, GNUNET_NO));
+ GNUNET_STRINGS_absolute_time_to_string (context->timeout));
GNUNET_NETWORK_fdset_zero (rs);
GNUNET_NETWORK_fdset_zero (ws);
GNUNET_NETWORK_fdset_set_native (ws, pos->fdi->sock);
}
}
+ struct GNUNET_TIME_Relative time_remaining =
+ GNUNET_TIME_absolute_get_remaining (context->timeout);
if (NULL == scheduler_select)
{
select_result = GNUNET_NETWORK_socket_select (rs,
ws,
NULL,
- context->timeout);
+ time_remaining);
}
else
{
rs,
ws,
NULL,
- context->timeout);
+ time_remaining);
}
if (select_result == GNUNET_SYSERR)
{
struct GNUNET_TIME_Absolute dt)
{
struct DriverContext *context = cls;
+
GNUNET_assert (NULL != context);
-
- context->timeout = GNUNET_TIME_absolute_get_remaining (dt);
+ context->timeout = dt;
}