#endif
#include "response-sched.h"
-#include "util.h"
+#include "timeval.h"
#include "log.h"
#define AVAHI_RESPONSE_HISTORY_MSEC 500
AvahiTimeEvent *time_event;
AvahiResponseJobState state;
- GTimeVal delivery;
+ struct timeval delivery;
AvahiRecord *record;
gboolean flush_cache;
static void elapse_callback(AvahiTimeEvent *e, gpointer data);
static void job_set_elapse_time(AvahiResponseScheduler *s, AvahiResponseJob *rj, guint msec, guint jitter) {
- GTimeVal tv;
+ struct timeval tv;
g_assert(s);
g_assert(rj);
job_set_elapse_time(s, rj, AVAHI_RESPONSE_HISTORY_MSEC, 0);
- g_get_current_time(&rj->delivery);
+ gettimeofday(&rj->delivery, NULL);
}
AvahiResponseScheduler *avahi_response_scheduler_new(AvahiInterface *i) {
gboolean avahi_response_scheduler_post(AvahiResponseScheduler *s, AvahiRecord *record, gboolean flush_cache, const AvahiAddress *querier, gboolean immediately) {
AvahiResponseJob *rj;
- GTimeVal tv;
+ struct timeval tv;
/* gchar *t; */
g_assert(s);
rj->flush_cache = flush_cache;
rj->querier_valid = FALSE;
- g_get_current_time(&rj->delivery);
+ gettimeofday(&rj->delivery, NULL);
job_set_elapse_time(s, rj, AVAHI_RESPONSE_HISTORY_MSEC, 0);
}
rj->querier = *querier;
}
- g_get_current_time(&rj->delivery);
+ gettimeofday(&rj->delivery, NULL);
job_set_elapse_time(s, rj, AVAHI_RESPONSE_SUPPRESS_MSEC, 0);
}