Ejemplo n.º 1
0
static void dns_ctx_handle_free(void *vh) {
  dns_ctx_handle_t *h = vh;
  assert(h->timeout == NULL);
  free(h->ns);
  dns_close(h->ctx);
  dns_free(h->ctx);
}
Ejemplo n.º 2
0
void
resolv_shutdown(struct ev_loop * loop) {
    struct dns_ctx *ctx = (struct dns_ctx *)resolv_io_watcher.data;

    ev_io_stop(loop, &resolv_io_watcher);

    if (ev_is_active(&resolv_timeout_watcher))
        ev_timer_stop(loop, &resolv_timeout_watcher);

    dns_close(ctx);
}
Ejemplo n.º 3
0
/*@null@*/
static PyObject*
Resolver_close(Resolver *self, PyObject *args) {
    if (args && !PyArg_ParseTuple(args, "")) {
        PyErr_SetString(PyExc_TypeError, "Resolver.close() takes no arguments.");
        return NULL;
    }

    dns_close(self->ctx);

    Py_RETURN_NONE;
}
Ejemplo n.º 4
0
static void dns_ctx_handle_free(void *vh) {
  dns_ctx_handle_t *h = vh;
  free(h->ns);
  eventer_remove_fd(h->e->fd);
  eventer_free(h->e);
  h->e = NULL;
  if(h->timeout) {
    eventer_remove(h->timeout);
    eventer_free(h->timeout);
    h->timeout = NULL;
  }
  dns_close(h->ctx);
  dns_free(h->ctx);
  assert(h->timeout == NULL);
  free(h);
}