Exemplo n.º 1
0
static void
xfrout_senddone(isc_task_t *task, isc_event_t *event) {
	isc_socketevent_t *sev = (isc_socketevent_t *)event;
	xfrout_ctx_t *xfr = (xfrout_ctx_t *)event->ev_arg;
	isc_result_t evresult = sev->result;

	UNUSED(task);

	INSIST(event->ev_type == ISC_SOCKEVENT_SENDDONE);

	isc_event_free(&event);
	xfr->sends--;
	INSIST(xfr->sends == 0);

	(void)isc_timer_touch(xfr->client->timer);
	if (xfr->shuttingdown == ISC_TRUE) {
		xfrout_maybe_destroy(xfr);
	} else if (evresult != ISC_R_SUCCESS) {
		xfrout_fail(xfr, evresult, "send");
	} else if (xfr->end_of_stream == ISC_FALSE) {
		sendstream(xfr);
	} else {
		/* End of zone transfer stream. */
		inc_stats(xfr->zone, dns_nsstatscounter_xfrdone);
		xfrout_log(xfr, ISC_LOG_INFO, "%s ended", xfr->mnemonic);
		ns_client_next(xfr->client, ISC_R_SUCCESS);
		xfrout_ctx_destroy(&xfr);
	}
}
Exemplo n.º 2
0
static void tick (isc_task_t * task, isc_event_t * event)
{
    char *name = event->ev_arg;

    INSIST (event->ev_type == ISC_TIMEREVENT_TICK);

    printf ("task %s (%p) tick\n", name, task);

    tick_count++;
    if (ti3 != NULL && tick_count % 3 == 0)
        isc_timer_touch (ti3);

    if (ti3 != NULL && tick_count == 7)
    {
        isc_time_t expires;

        isc_interval_t interval;

        isc_interval_set (&interval, 5, 0);
        (void) isc_time_nowplusinterval (&expires, &interval);
        isc_interval_set (&interval, 4, 0);
        printf ("*** resetting ti3 ***\n");
        RUNTIME_CHECK (isc_timer_reset (ti3, isc_timertype_once, &expires, &interval, ISC_TRUE) == ISC_R_SUCCESS);
    }

    isc_event_free (&event);
}