Cython: cares.pyx

Generated by Cython 3.1.4

Yellow lines hint at Python interaction.
Click on a line that starts with a "`+`" to see the C code that Cython generated for it.

Raw output: cares.c

    +001: # Copyright (c) 2011-2012 Denis Bilenko. See LICENSE for details.

      __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

     002: # Automatic pickling of cdef classes was added in 0.26. Unfortunately it

     003: # seems to be buggy (at least for the `result` class) and produces code that

     004: # can't compile ("local variable 'result' referenced before assignment").

     005: # See https://github.com/cython/cython/issues/1786

     006: # cython: auto_pickle=False,language_level=3str

     007: cimport libcares as cares

    +008: import sys

      __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_sys, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sys, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     009:

     010: from cpython.version cimport PY_MAJOR_VERSION

     011: from cpython.tuple cimport PyTuple_Check

     012: from cpython.getargs cimport PyArg_ParseTuple

     013: from cpython.ref cimport Py_INCREF

     014: from cpython.ref cimport Py_DECREF

     015: from cpython.mem cimport PyMem_Malloc

     016: from cpython.mem cimport PyMem_Free

     017: from libc.string cimport memset

     018:

    +019: from gevent._compat import MAC

      __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_MAC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_gevent__compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MAC); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MAC, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     020:

    +021: import _socket

      __pyx_t_3 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_socket, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 21, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_socket, __pyx_t_3) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +022: from _socket import gaierror

      __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_gaierror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_socket, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_gaierror); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_gaierror, __pyx_t_3) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +023: from _socket import herror

      __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_herror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_socket, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_herror); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_herror, __pyx_t_2) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     024:

     025:

    +026: __all__ = ['channel']

      __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_channel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_all, __pyx_t_3) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     027:

     028:

     029: # These three constants used to be DEF, but the DEF construct

     030: # is deprecated in Cython. Using a cdef extern, the generated

     031: # C code refers to the symbol (DEF would have inlined the value).

     032: # That's great when we're strictly in a C context, but for passing to

     033: # Python, it means we do a runtime translation from the C int to the

     034: # Python int. That is avoided if we use a cdef constant. TIMEOUT

     035: # is the only one that interacts with Python, but not in a performance-sensitive

     036: # way, so runtime translation is fine to keep it consistent.

     037: cdef extern from *:

     038:     """

     039:     #define TIMEOUT 1

     040:     #define EV_READ 1

     041:     #define EV_WRITE 2

     042:     """

     043:     int TIMEOUT

     044:     int EV_READ

     045:     int EV_WRITE

     046:

     047:

     048: cdef extern from *:

     049:     """

     050: #ifdef CARES_EMBED

     051: #include "ares_setup.h"

     052: #endif

     053:

     054: #ifdef HAVE_NETDB_H

     055: #include <netdb.h>

     056: #endif

     057:

     058:     #ifndef EAI_ADDRFAMILY

     059:     #define EAI_ADDRFAMILY -1

     060:     #endif

     061:

     062:     #ifndef EAI_BADHINTS

     063:     #define EAI_BADHINTS -2

     064:     #endif

     065:

     066:     #ifndef EAI_NODATA

     067:     #define EAI_NODATA -3

     068:     #endif

     069:

     070:     #ifndef EAI_OVERFLOW

     071:     #define EAI_OVERFLOW -4

     072:     #endif

     073:

     074:     #ifndef EAI_PROTOCOL

     075:     #define EAI_PROTOCOL -5

     076:     #endif

     077:

     078:     #ifndef EAI_SYSTEM

     079:     #define EAI_SYSTEM

     080:     #endif

     081: #if defined(WIN32) || defined(_WIN32)

     082:     static const char * hstrerror(int err)

     083:     {

     084:         return NULL;

     085:     }

     086: #endif

     087:     """

     088:

     089: cdef extern from "ares.h":

     090:     int AF_INET

     091:     int AF_INET6

     092:     int INET6_ADDRSTRLEN

     093:

     094:     struct hostent:

     095:         char* h_name

     096:         int h_addrtype

     097:         char** h_aliases

     098:         char** h_addr_list

     099:

     100:     struct sockaddr_t "sockaddr":

     101:         pass

     102:

     103:     struct ares_channeldata:

     104:         pass

     105:

     106:     struct in_addr:

     107:         unsigned int s_addr

     108:

     109:     struct sockaddr_in:

     110:         int sin_family

     111:         int sin_port

     112:         in_addr sin_addr

     113:

     114:     struct in6_addr:

     115:         char s6_addr[16]

     116:

     117:     struct sockaddr_in6:

     118:         int sin6_family

     119:         int sin6_port

     120:         unsigned int sin6_flowinfo

     121:         in6_addr sin6_addr

     122:         unsigned int sin6_scope_id

     123:

     124:

     125:     unsigned int htons(unsigned int hostshort)

     126:     unsigned int ntohs(unsigned int hostshort)

     127:     unsigned int htonl(unsigned int hostlong)

     128:     unsigned int ntohl(unsigned int hostlong)

     129:

    +130: cdef int AI_NUMERICSERV = _socket.AI_NUMERICSERV

      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 130, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_AI_NUMERICSERV); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 130, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_6gevent_8resolver_5cares_AI_NUMERICSERV = __pyx_t_4;

    +131: cdef int AI_CANONNAME = _socket.AI_CANONNAME

      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 131, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_AI_CANONNAME); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 131, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_6gevent_8resolver_5cares_AI_CANONNAME = __pyx_t_4;

    +132: cdef int NI_NUMERICHOST = _socket.NI_NUMERICHOST

      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_NI_NUMERICHOST); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_6gevent_8resolver_5cares_NI_NUMERICHOST = __pyx_t_4;

    +133: cdef int NI_NUMERICSERV = _socket.NI_NUMERICSERV

      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_NI_NUMERICSERV); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_6gevent_8resolver_5cares_NI_NUMERICSERV = __pyx_t_4;

    +134: cdef int NI_NOFQDN = _socket.NI_NOFQDN

      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_NI_NOFQDN); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 134, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_6gevent_8resolver_5cares_NI_NOFQDN = __pyx_t_4;

    +135: cdef int NI_NAMEREQD = _socket.NI_NAMEREQD

      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_NI_NAMEREQD); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_6gevent_8resolver_5cares_NI_NAMEREQD = __pyx_t_4;

    +136: cdef int NI_DGRAM = _socket.NI_DGRAM

      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_NI_DGRAM); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_6gevent_8resolver_5cares_NI_DGRAM = __pyx_t_4;

     137:

     138:

    +139: cdef dict _ares_errors = dict([

      __pyx_t_3 = NULL;
      __Pyx_INCREF((PyObject *)(&PyDict_Type));
      __pyx_t_5 = ((PyObject *)(&PyDict_Type));
    /* … */
      __pyx_t_6 = __Pyx_PyList_Pack(26, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14, __pyx_t_15, __pyx_t_16, __pyx_t_17, __pyx_t_18, __pyx_t_19, __pyx_t_20, __pyx_t_21, __pyx_t_22, __pyx_t_23, __pyx_t_24, __pyx_t_25, __pyx_t_26, __pyx_t_27, __pyx_t_28, __pyx_t_29, __pyx_t_30, __pyx_t_31, __pyx_t_32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 139, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
      __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
      __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
      __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
      __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
      __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
      __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
      __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
      __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
      __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
      __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
      __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
      __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
      __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
      __pyx_t_33 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_6};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_33, (2-__pyx_t_33) | (__pyx_t_33*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 139, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares__ares_errors);
      __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares__ares_errors, ((PyObject*)__pyx_t_2));
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;

    +140:     (cares.ARES_SUCCESS, 'ARES_SUCCESS'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_SUCCESS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 140, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_SUCCESS); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 140, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

     141:

    +142:     (cares.ARES_EADDRGETNETWORKPARAMS, 'ARES_EADDRGETNETWORKPARAMS'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_EADDRGETNETWORKPARAMS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_EADDRGETNETWORKPARAMS); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 142, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +143:     (cares.ARES_EBADFAMILY, 'ARES_EBADFAMILY'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_EBADFAMILY); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 143, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_9 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_EBADFAMILY); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 143, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +144:     (cares.ARES_EBADFLAGS, 'ARES_EBADFLAGS'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_EBADFLAGS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_10 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_EBADFLAGS); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 144, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +145:     (cares.ARES_EBADHINTS, 'ARES_EBADHINTS'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_EBADHINTS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_11 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_EBADHINTS); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 145, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +146:     (cares.ARES_EBADNAME, 'ARES_EBADNAME'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_EBADNAME); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_12 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_EBADNAME); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +147:     (cares.ARES_EBADQUERY, 'ARES_EBADQUERY'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_EBADQUERY); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_13 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_EBADQUERY); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 147, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +148:     (cares.ARES_EBADRESP, 'ARES_EBADRESP'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_EBADRESP); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_14 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_EBADRESP); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 148, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_14);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +149:     (cares.ARES_EBADSTR, 'ARES_EBADSTR'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_EBADSTR); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 149, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_15 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_EBADSTR); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 149, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +150:     (cares.ARES_ECANCELLED, 'ARES_ECANCELLED'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_ECANCELLED); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_16 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_ECANCELLED); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 150, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +151:     (cares.ARES_ECONNREFUSED, 'ARES_ECONNREFUSED'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_ECONNREFUSED); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_17 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_ECONNREFUSED); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_17);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +152:     (cares.ARES_EDESTRUCTION, 'ARES_EDESTRUCTION'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 152, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_18 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_EDESTRUCTION); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 152, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_18);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +153:     (cares.ARES_EFILE, 'ARES_EFILE'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_EFILE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_19 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_EFILE); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +154:     (cares.ARES_EFORMERR, 'ARES_EFORMERR'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_EFORMERR); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 154, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_20 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_EFORMERR); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 154, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +155:     (cares.ARES_ELOADIPHLPAPI, 'ARES_ELOADIPHLPAPI'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_ELOADIPHLPAPI); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 155, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_21 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_ELOADIPHLPAPI); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 155, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_21);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +156:     (cares.ARES_ENODATA, 'ARES_ENODATA'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_ENODATA); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_22 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_ENODATA); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_22);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +157:     (cares.ARES_ENOMEM, 'ARES_ENOMEM'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_ENOMEM); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_23 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_ENOMEM); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_23);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +158:     (cares.ARES_ENONAME, 'ARES_ENONAME'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_ENONAME); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 158, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_24 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_ENONAME); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 158, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_24);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +159:     (cares.ARES_ENOTFOUND, 'ARES_ENOTFOUND'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_ENOTFOUND); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_25 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_ENOTFOUND); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_25);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +160:     (cares.ARES_ENOTIMP, 'ARES_ENOTIMP'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_ENOTIMP); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_26 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_ENOTIMP); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_26);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +161:     (cares.ARES_ENOTINITIALIZED, 'ARES_ENOTINITIALIZED'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_ENOTINITIALIZED); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_27 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_ENOTINITIALIZED); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 161, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_27);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +162:     (cares.ARES_EOF, 'ARES_EOF'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_EOF); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_28 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_EOF); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_28);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +163:     (cares.ARES_EREFUSED, 'ARES_EREFUSED'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_EREFUSED); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_29 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_EREFUSED); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_29);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +164:     (cares.ARES_ESERVICE, 'ARES_ESERVICE'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_ESERVICE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_30 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_ESERVICE); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_30);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +165:     (cares.ARES_ESERVFAIL, 'ARES_ESERVFAIL'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_ESERVFAIL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 165, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_31 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_ESERVFAIL); if (unlikely(!__pyx_t_31)) __PYX_ERR(0, 165, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_31);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +166:     (cares.ARES_ETIMEOUT, 'ARES_ETIMEOUT'),

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_ETIMEOUT); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_32 = PyTuple_Pack(2, __pyx_t_6, __pyx_mstate_global->__pyx_n_u_ARES_ETIMEOUT); if (unlikely(!__pyx_t_32)) __PYX_ERR(0, 166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_32);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

     167: ])

     168:

     169: cdef dict _ares_to_gai_system = {

    +170:     cares.ARES_EBADFAMILY: cares.EAI_ADDRFAMILY,

      __pyx_t_2 = __Pyx_PyDict_NewPresized(9); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_PyLong_From_int(ARES_EBADFAMILY); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 170, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyLong_From_int(EAI_ADDRFAMILY); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 170, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_6) < 0) __PYX_ERR(0, 170, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +171:     cares.ARES_EBADFLAGS:  cares.EAI_BADFLAGS,

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_EBADFLAGS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_PyLong_From_int(EAI_BADFLAGS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_2, __pyx_t_6, __pyx_t_5) < 0) __PYX_ERR(0, 170, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    +172:     cares.ARES_EBADHINTS:  cares.EAI_BADHINTS,

      __pyx_t_5 = __Pyx_PyLong_From_int(ARES_EBADHINTS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 172, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyLong_From_int(EAI_BADHINTS); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 172, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_6) < 0) __PYX_ERR(0, 170, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +173:     cares.ARES_ENOMEM:     cares.EAI_MEMORY,

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_ENOMEM); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_PyLong_From_int(EAI_MEMORY); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 173, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_2, __pyx_t_6, __pyx_t_5) < 0) __PYX_ERR(0, 170, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    +174:     cares.ARES_ENONAME:    cares.EAI_NONAME,

      __pyx_t_5 = __Pyx_PyLong_From_int(ARES_ENONAME); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 174, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyLong_From_int(EAI_NONAME); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 174, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_6) < 0) __PYX_ERR(0, 170, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +175:     cares.ARES_ENOTFOUND:  cares.EAI_NONAME,

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_ENOTFOUND); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_PyLong_From_int(EAI_NONAME); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_2, __pyx_t_6, __pyx_t_5) < 0) __PYX_ERR(0, 170, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    +176:     cares.ARES_ENOTIMP:    cares.EAI_FAMILY,

      __pyx_t_5 = __Pyx_PyLong_From_int(ARES_ENOTIMP); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 176, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyLong_From_int(EAI_FAMILY); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 176, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_6) < 0) __PYX_ERR(0, 170, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

     177:     # While EAI_NODATA ("No address associated with nodename") might

     178:     # seem to be the natural mapping, typical resolvers actually

     179:     # return EAI_NONAME in that same situation; I've yet to find EAI_NODATA

     180:     # in a test.

    +181:     cares.ARES_ENODATA:    cares.EAI_NONAME,

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_ENODATA); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_PyLong_From_int(EAI_NONAME); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_2, __pyx_t_6, __pyx_t_5) < 0) __PYX_ERR(0, 170, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

     182:     # This one gets raised for unknown port/service names.

    +183:     cares.ARES_ESERVICE:   cares.EAI_NONAME if MAC else cares.EAI_SERVICE,

      __pyx_t_5 = __Pyx_PyLong_From_int(ARES_ESERVICE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_MAC); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_34 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_34 < 0))) __PYX_ERR(0, 183, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_34) {
        __pyx_t_3 = __Pyx_PyLong_From_int(EAI_NONAME); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = __pyx_t_3;
        __pyx_t_3 = 0;
      } else {
        __pyx_t_3 = __Pyx_PyLong_From_int(EAI_SERVICE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 183, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6 = __pyx_t_3;
        __pyx_t_3 = 0;
      }
      if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_6) < 0) __PYX_ERR(0, 170, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares__ares_to_gai_system);
      __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares__ares_to_gai_system, ((PyObject*)__pyx_t_2));
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;

     184: }

     185:

    +186: cdef _gevent_gai_strerror(code):

    static PyObject *__pyx_f_6gevent_8resolver_5cares__gevent_gai_strerror(PyObject *__pyx_v_code) {
      char const *__pyx_v_err_str;
      PyObject *__pyx_v_result = 0;
      int __pyx_v_system;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_AddTraceback("gevent.resolver.cares._gevent_gai_strerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_result);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     187:     cdef const char* err_str

    +188:     cdef object result = None

      __Pyx_INCREF(Py_None);
      __pyx_v_result = Py_None;

     189:     cdef int system

    +190:     try:

      {
        /*try:*/ {
    /* … */
        }
    /* … */
        __pyx_L5_except_error:;
        __Pyx_XGIVEREF(__pyx_t_1);
        __Pyx_XGIVEREF(__pyx_t_2);
        __Pyx_XGIVEREF(__pyx_t_3);
        __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
        goto __pyx_L1_error;
        __pyx_L4_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_1);
        __Pyx_XGIVEREF(__pyx_t_2);
        __Pyx_XGIVEREF(__pyx_t_3);
        __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
        __pyx_L8_try_end:;
      }

    +191:         system = _ares_to_gai_system[code]

          if (unlikely(__pyx_v_6gevent_8resolver_5cares__ares_to_gai_system == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(0, 191, __pyx_L3_error)
          }
          __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_6gevent_8resolver_5cares__ares_to_gai_system, __pyx_v_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 191, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_v_system = __pyx_t_5;

    +192:     except KeyError:

        __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
        if (__pyx_t_5) {
          __Pyx_AddTraceback("gevent.resolver.cares._gevent_gai_strerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 192, __pyx_L5_except_error)
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_7);

    +193:         err_str = cares.ares_strerror(code)

          __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_v_code); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 193, __pyx_L5_except_error)
          __pyx_v_err_str = ares_strerror(__pyx_t_5);

    +194:         result = '%s: %s' % (_ares_errors.get(code) or code, _as_str(err_str))

          if (unlikely(__pyx_v_6gevent_8resolver_5cares__ares_errors == Py_None)) {
            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
            __PYX_ERR(0, 194, __pyx_L5_except_error)
          }
          __pyx_t_9 = __Pyx_PyDict_GetItemDefault(__pyx_v_6gevent_8resolver_5cares__ares_errors, __pyx_v_code, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 194, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 194, __pyx_L5_except_error)
          if (!__pyx_t_10) {
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          } else {
            __Pyx_INCREF(__pyx_t_9);
            __pyx_t_8 = __pyx_t_9;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            goto __pyx_L11_bool_binop_done;
          }
          __Pyx_INCREF(__pyx_v_code);
          __pyx_t_8 = __pyx_v_code;
          __pyx_L11_bool_binop_done:;
          __pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_8), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 194, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_8 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_err_str); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 194, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_11 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_8), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 194, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_12[0] = __pyx_t_9;
          __pyx_t_12[1] = __pyx_mstate_global->__pyx_kp_u_;
          __pyx_t_12[2] = __pyx_t_11;
          __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_12, 3, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11));
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 194, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_8);
          __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          goto __pyx_L4_exception_handled;
        }
        goto __pyx_L5_except_error;

     195:     else:

    +196:         err_str = cares.gai_strerror(system)

        /*else:*/ {
          __pyx_v_err_str = gai_strerror(__pyx_v_system);

    +197:         result = _as_str(err_str)

          __pyx_t_4 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_err_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_4);
          __pyx_t_4 = 0;
        }
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L8_try_end;
        __pyx_L3_error:;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    +198:     return result

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

     199:

    +200: cdef object _gevent_gaierror_from_status(int ares_status):

    static PyObject *__pyx_f_6gevent_8resolver_5cares__gevent_gaierror_from_status(int __pyx_v_ares_status) {
      PyObject *__pyx_v_code = 0;
      PyObject *__pyx_v_message = 0;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("gevent.resolver.cares._gevent_gaierror_from_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_code);
      __Pyx_XDECREF(__pyx_v_message);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +201:     cdef object code = _ares_to_gai_system.get(ares_status, ares_status)

      if (unlikely(__pyx_v_6gevent_8resolver_5cares__ares_to_gai_system == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
        __PYX_ERR(0, 201, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_ares_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 201, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_ares_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 201, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_6gevent_8resolver_5cares__ares_to_gai_system, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_code = __pyx_t_3;
      __pyx_t_3 = 0;

    +202:     cdef object message = _gevent_gai_strerror(ares_status)

      __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_ares_status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __pyx_f_6gevent_8resolver_5cares__gevent_gai_strerror(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_message = __pyx_t_2;
      __pyx_t_2 = 0;

    +203:     return gaierror(code, message)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_gaierror); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
        assert(__pyx_t_3);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
        __pyx_t_4 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_code, __pyx_v_message};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

     204:

     205: cdef dict _ares_to_host_system = {

    +206:     cares.ARES_ENONAME:    cares.HOST_NOT_FOUND,

      __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_ENONAME); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_PyLong_From_int(HOST_NOT_FOUND); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 206, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_2, __pyx_t_6, __pyx_t_5) < 0) __PYX_ERR(0, 206, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    +207:     cares.ARES_ENOTFOUND:  cares.HOST_NOT_FOUND,

      __pyx_t_5 = __Pyx_PyLong_From_int(ARES_ENOTFOUND); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 207, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyLong_From_int(HOST_NOT_FOUND); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (PyDict_SetItem(__pyx_t_2, __pyx_t_5, __pyx_t_6) < 0) __PYX_ERR(0, 206, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +208:     cares.ARES_ENODATA:    cares.NO_DATA,

      __pyx_t_6 = __Pyx_PyLong_From_int(ARES_ENODATA); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 208, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_PyLong_From_int(NO_DATA); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 208, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_2, __pyx_t_6, __pyx_t_5) < 0) __PYX_ERR(0, 206, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XGOTREF(__pyx_v_6gevent_8resolver_5cares__ares_to_host_system);
      __Pyx_DECREF_SET(__pyx_v_6gevent_8resolver_5cares__ares_to_host_system, ((PyObject*)__pyx_t_2));
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;

     209: }

     210:

    +211: cdef _gevent_herror_strerror(code):

    static PyObject *__pyx_f_6gevent_8resolver_5cares__gevent_herror_strerror(PyObject *__pyx_v_code) {
      char const *__pyx_v_err_str;
      PyObject *__pyx_v_result = 0;
      int __pyx_v_system;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_AddTraceback("gevent.resolver.cares._gevent_herror_strerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_result);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     212:     cdef const char* err_str

    +213:     cdef object result = None

      __Pyx_INCREF(Py_None);
      __pyx_v_result = Py_None;

     214:     cdef int system

    +215:     try:

      {
        /*try:*/ {
    /* … */
        }
    /* … */
        __pyx_L5_except_error:;
        __Pyx_XGIVEREF(__pyx_t_1);
        __Pyx_XGIVEREF(__pyx_t_2);
        __Pyx_XGIVEREF(__pyx_t_3);
        __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
        goto __pyx_L1_error;
        __pyx_L4_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_1);
        __Pyx_XGIVEREF(__pyx_t_2);
        __Pyx_XGIVEREF(__pyx_t_3);
        __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
        __pyx_L8_try_end:;
      }

    +216:         system = _ares_to_host_system[code]

          if (unlikely(__pyx_v_6gevent_8resolver_5cares__ares_to_host_system == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
            __PYX_ERR(0, 216, __pyx_L3_error)
          }
          __pyx_t_4 = __Pyx_PyDict_GetItem(__pyx_v_6gevent_8resolver_5cares__ares_to_host_system, __pyx_v_code); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 216, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L3_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_v_system = __pyx_t_5;

    +217:     except KeyError:

        __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
        if (__pyx_t_5) {
          __Pyx_AddTraceback("gevent.resolver.cares._gevent_herror_strerror", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 217, __pyx_L5_except_error)
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_7);

    +218:         err_str = cares.ares_strerror(code)

          __pyx_t_5 = __Pyx_PyLong_As_int(__pyx_v_code); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 218, __pyx_L5_except_error)
          __pyx_v_err_str = ares_strerror(__pyx_t_5);

    +219:         result = '%s: %s' % (_ares_errors.get(code) or code, _as_str(err_str))

          if (unlikely(__pyx_v_6gevent_8resolver_5cares__ares_errors == Py_None)) {
            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
            __PYX_ERR(0, 219, __pyx_L5_except_error)
          }
          __pyx_t_9 = __Pyx_PyDict_GetItemDefault(__pyx_v_6gevent_8resolver_5cares__ares_errors, __pyx_v_code, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 219, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 219, __pyx_L5_except_error)
          if (!__pyx_t_10) {
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          } else {
            __Pyx_INCREF(__pyx_t_9);
            __pyx_t_8 = __pyx_t_9;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            goto __pyx_L11_bool_binop_done;
          }
          __Pyx_INCREF(__pyx_v_code);
          __pyx_t_8 = __pyx_v_code;
          __pyx_L11_bool_binop_done:;
          __pyx_t_9 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_8), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 219, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_8 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_err_str); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 219, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_11 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_8), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 219, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __pyx_t_12[0] = __pyx_t_9;
          __pyx_t_12[1] = __pyx_mstate_global->__pyx_kp_u_;
          __pyx_t_12[2] = __pyx_t_11;
          __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_12, 3, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_9) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_9) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11));
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 219, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_8);
          __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          goto __pyx_L4_exception_handled;
        }
        goto __pyx_L5_except_error;

     220:     else:

    +221:         err_str = cares.hstrerror(system)

        /*else:*/ {
          __pyx_v_err_str = hstrerror(__pyx_v_system);

    +222:         result = _as_str(err_str)

          __pyx_t_4 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_err_str); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_4);
          __pyx_t_4 = 0;
        }
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        goto __pyx_L8_try_end;
        __pyx_L3_error:;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

    +223:     return result

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

     224:

     225:

    +226: cdef object _gevent_herror_from_status(int ares_status):

    static PyObject *__pyx_f_6gevent_8resolver_5cares__gevent_herror_from_status(int __pyx_v_ares_status) {
      PyObject *__pyx_v_code = 0;
      PyObject *__pyx_v_message = 0;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("gevent.resolver.cares._gevent_herror_from_status", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_code);
      __Pyx_XDECREF(__pyx_v_message);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +227:     cdef object code = _ares_to_host_system.get(ares_status, ares_status)

      if (unlikely(__pyx_v_6gevent_8resolver_5cares__ares_to_host_system == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
        __PYX_ERR(0, 227, __pyx_L1_error)
      }
      __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_ares_status); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_ares_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_6gevent_8resolver_5cares__ares_to_host_system, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_code = __pyx_t_3;
      __pyx_t_3 = 0;

    +228:     cdef object message = _gevent_herror_strerror(ares_status)

      __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_ares_status); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __pyx_f_6gevent_8resolver_5cares__gevent_herror_strerror(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 228, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_message = __pyx_t_2;
      __pyx_t_2 = 0;

    +229:     return herror(code, message)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_herror); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 229, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
        assert(__pyx_t_3);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
        __pyx_t_4 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_code, __pyx_v_message};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 229, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

     230:

     231:

    +232: class InvalidIP(ValueError):

      __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(1, __pyx_builtin_ValueError); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 232, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);
    /* … */
      __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_mstate_global->__pyx_tuple[1]); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 232, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_InvalidIP, __pyx_mstate_global->__pyx_n_u_InvalidIP, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 232, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_2 != __pyx_mstate_global->__pyx_tuple[1]) {
        if (unlikely((PyDict_SetItemString(__pyx_t_6, "__orig_bases__", __pyx_mstate_global->__pyx_tuple[1]) < 0))) __PYX_ERR(0, 232, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_InvalidIP, __pyx_t_2, __pyx_t_6, NULL, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 232, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_InvalidIP, __pyx_t_3) < 0) __PYX_ERR(0, 232, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(1, __pyx_builtin_ValueError); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 232, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);

     233:     pass

     234:

     235:

    +236: cdef void gevent_sock_state_callback(void *data, int s, int read, int write):

    static void __pyx_f_6gevent_8resolver_5cares_gevent_sock_state_callback(void *__pyx_v_data, int __pyx_v_s, int __pyx_v_read, int __pyx_v_write) {
      struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_ch = 0;
    /* … */
      /* function exit code */
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent.resolver.cares.gevent_sock_state_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_L0:;
      __Pyx_XDECREF((PyObject *)__pyx_v_ch);
      __Pyx_RefNannyFinishContext();
    }

    +237:     if not data:

      __pyx_t_1 = (!(__pyx_v_data != 0));
      if (__pyx_t_1) {
    /* … */
      }

    +238:         return

        goto __pyx_L0;

    +239:     cdef channel ch = <channel>data

      __pyx_t_2 = ((PyObject *)__pyx_v_data);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_v_ch = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_t_2);
      __pyx_t_2 = 0;

    +240:     ch._sock_state_callback(s, read, write)

      __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *)__pyx_v_ch->__pyx_vtab)->_sock_state_callback(__pyx_v_ch, __pyx_v_s, __pyx_v_read, __pyx_v_write); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     241:

     242:

    +243: cdef class Result(object):

    struct __pyx_obj_6gevent_8resolver_5cares_Result {
      PyObject_HEAD
      PyObject *value;
      PyObject *exception;
    };

    +244:     cdef public object value

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_5value_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_5value_1__get__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_5value___get__(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_6Result_5value___get__(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self->value);
      __pyx_r = __pyx_v_self->value;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_5value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_5value_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_5value_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self), ((PyObject *)__pyx_v_value));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static int __pyx_pf_6gevent_8resolver_5cares_6Result_5value_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self, PyObject *__pyx_v_value) {
      int __pyx_r;
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      __Pyx_GOTREF(__pyx_v_self->value);
      __Pyx_DECREF(__pyx_v_self->value);
      __pyx_v_self->value = __pyx_v_value;

      /* function exit code */
      __pyx_r = 0;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_5value_5__del__(PyObject *__pyx_v_self); /*proto*/
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_5value_5__del__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_5value_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static int __pyx_pf_6gevent_8resolver_5cares_6Result_5value_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self) {
      int __pyx_r;
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF(__pyx_v_self->value);
      __Pyx_DECREF(__pyx_v_self->value);
      __pyx_v_self->value = Py_None;

      /* function exit code */
      __pyx_r = 0;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +245:     cdef public object exception

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_9exception_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_9exception_1__get__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_9exception___get__(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_6Result_9exception___get__(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self->exception);
      __pyx_r = __pyx_v_self->exception;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_9exception_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_9exception_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_9exception_2__set__(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self), ((PyObject *)__pyx_v_value));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static int __pyx_pf_6gevent_8resolver_5cares_6Result_9exception_2__set__(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self, PyObject *__pyx_v_value) {
      int __pyx_r;
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      __Pyx_GOTREF(__pyx_v_self->exception);
      __Pyx_DECREF(__pyx_v_self->exception);
      __pyx_v_self->exception = __pyx_v_value;

      /* function exit code */
      __pyx_r = 0;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_9exception_5__del__(PyObject *__pyx_v_self); /*proto*/
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_9exception_5__del__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_9exception_4__del__(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static int __pyx_pf_6gevent_8resolver_5cares_6Result_9exception_4__del__(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self) {
      int __pyx_r;
      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF(__pyx_v_self->exception);
      __Pyx_DECREF(__pyx_v_self->exception);
      __pyx_v_self->exception = Py_None;

      /* function exit code */
      __pyx_r = 0;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     246:

    +247:     def __init__(self, object value=None, object exception=None):

    /* Python wrapper */
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static int __pyx_pw_6gevent_8resolver_5cares_6Result_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_value = 0;
      PyObject *__pyx_v_exception = 0;
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
      #endif
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      {
        PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_value,&__pyx_mstate_global->__pyx_n_u_exception,0};
      PyObject* values[2] = {0,0};
        const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
        if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 247, __pyx_L3_error)
        if (__pyx_kwds_len > 0) {
          switch (__pyx_nargs) {
            case  2:
            values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 247, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  1:
            values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 247, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          const Py_ssize_t kwd_pos_args = __pyx_nargs;
          if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 247, __pyx_L3_error)
          if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
          if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
        } else {
          switch (__pyx_nargs) {
            case  2:
            values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 247, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  1:
            values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 247, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
          if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
        }
        __pyx_v_value = values[0];
        __pyx_v_exception = values[1];
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 247, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __Pyx_AddTraceback("gevent.resolver.cares.Result.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return -1;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result___init__(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self), __pyx_v_value, __pyx_v_exception);

      /* function exit code */
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static int __pyx_pf_6gevent_8resolver_5cares_6Result___init__(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self, PyObject *__pyx_v_value, PyObject *__pyx_v_exception) {
      int __pyx_r;
    /* … */
      /* function exit code */
      __pyx_r = 0;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +248:         self.value = value

      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      __Pyx_GOTREF(__pyx_v_self->value);
      __Pyx_DECREF(__pyx_v_self->value);
      __pyx_v_self->value = __pyx_v_value;

    +249:         self.exception = exception

      __Pyx_INCREF(__pyx_v_exception);
      __Pyx_GIVEREF(__pyx_v_exception);
      __Pyx_GOTREF(__pyx_v_self->exception);
      __Pyx_DECREF(__pyx_v_self->exception);
      __pyx_v_self->exception = __pyx_v_exception;

     250:

    +251:     def __repr__(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_3__repr__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_3__repr__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_2__repr__(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_6Result_2__repr__(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_7);
      __Pyx_AddTraceback("gevent.resolver.cares.Result.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +252:         if self.exception is None:

      __pyx_t_1 = (__pyx_v_self->exception == Py_None);
      if (__pyx_t_1) {
    /* … */
      }

    +253:             return '%s(%r)' % (self.__class__.__name__, self.value)

        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_3), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_self->value), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 253, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4[0] = __pyx_t_2;
        __pyx_t_4[1] = __pyx_mstate_global->__pyx_kp_u__2;
        __pyx_t_4[2] = __pyx_t_3;
        __pyx_t_4[3] = __pyx_mstate_global->__pyx_kp_u__3;
        __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_4, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 1 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 253, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L0;

    +254:         elif self.value is None:

      __pyx_t_1 = (__pyx_v_self->value == Py_None);
      if (__pyx_t_1) {
    /* … */
      }

    +255:             return '%s(exception=%r)' % (self.__class__.__name__, self.exception)

        __Pyx_XDECREF(__pyx_r);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 255, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 255, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_3), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 255, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_self->exception), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 255, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4[0] = __pyx_t_5;
        __pyx_t_4[1] = __pyx_mstate_global->__pyx_kp_u_exception_2;
        __pyx_t_4[2] = __pyx_t_3;
        __pyx_t_4[3] = __pyx_mstate_global->__pyx_kp_u__3;
        __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_4, 4, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 11 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        goto __pyx_L0;

     256:         else:

    +257:             return '%s(value=%r, exception=%r)' % (self.__class__.__name__, self.value, self.exception)

      /*else*/ {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_3), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_self->value), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_self->exception), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 257, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6[0] = __pyx_t_2;
        __pyx_t_6[1] = __pyx_mstate_global->__pyx_kp_u_value_2;
        __pyx_t_6[2] = __pyx_t_3;
        __pyx_t_6[3] = __pyx_mstate_global->__pyx_kp_u_exception_3;
        __pyx_t_6[4] = __pyx_t_5;
        __pyx_t_6[5] = __pyx_mstate_global->__pyx_kp_u__3;
        __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_6, 6, __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 7 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 12 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 257, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_r = __pyx_t_7;
        __pyx_t_7 = 0;
        goto __pyx_L0;
      }

     258:         # add repr_recursive precaution

     259:

    +260:     def successful(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_5successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_6Result_5successful = {"successful", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_6Result_5successful, METH_NOARGS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_5successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("successful (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_4successful(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_6Result_4successful(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent.resolver.cares.Result.successful", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_6Result_5successful, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Result_successful, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 260, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_Result, __pyx_mstate_global->__pyx_n_u_successful, __pyx_t_2) < 0) __PYX_ERR(0, 260, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +261:         return self.exception is None

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = (__pyx_v_self->exception == Py_None);
      __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

     262:

    +263:     def get(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_7get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_6Result_7get = {"get", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_6Result_7get, METH_NOARGS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_6Result_7get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("get (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_6Result_6get(((struct __pyx_obj_6gevent_8resolver_5cares_Result *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_6Result_6get(struct __pyx_obj_6gevent_8resolver_5cares_Result *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_AddTraceback("gevent.resolver.cares.Result.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_6Result_7get, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Result_get, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_Result, __pyx_mstate_global->__pyx_n_u_get, __pyx_t_2) < 0) __PYX_ERR(0, 263, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +264:         if self.exception is not None:

      __pyx_t_1 = (__pyx_v_self->exception != Py_None);
      if (unlikely(__pyx_t_1)) {
    /* … */
      }

    +265:             raise self.exception

        __Pyx_Raise(__pyx_v_self->exception, 0, 0, 0);
        __PYX_ERR(0, 265, __pyx_L1_error)

    +266:         return self.value

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self->value);
      __pyx_r = __pyx_v_self->value;
      goto __pyx_L0;

     267:

     268:

    +269: class ares_host_result(tuple):

      __pyx_t_2 = PyTuple_Pack(1, ((PyObject *)(&PyTuple_Type))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_6, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_ares_host_result, __pyx_mstate_global->__pyx_n_u_ares_host_result, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__pyx_t_5 != __pyx_t_2) {
        if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 269, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /* … */
      __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_ares_host_result, __pyx_t_5, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ares_host_result, __pyx_t_2) < 0) __PYX_ERR(0, 269, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

     270:

    +271:     def __new__(cls, family, iterable):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_1__new__(PyObject *__pyx_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_1__new__ = {"__new__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_1__new__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_1__new__(PyObject *__pyx_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_cls = 0;
      PyObject *__pyx_v_family = 0;
      PyObject *__pyx_v_iterable = 0;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__new__ (wrapper)", 0);
      #if !CYTHON_METH_FASTCALL
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      #endif
      __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      {
        PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_cls,&__pyx_mstate_global->__pyx_n_u_family,&__pyx_mstate_global->__pyx_n_u_iterable,0};
      PyObject* values[3] = {0,0,0};
        const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
        if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 271, __pyx_L3_error)
        if (__pyx_kwds_len > 0) {
          switch (__pyx_nargs) {
            case  3:
            values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 271, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  2:
            values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 271, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  1:
            values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 271, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          const Py_ssize_t kwd_pos_args = __pyx_nargs;
          if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__new__", 0) < 0) __PYX_ERR(0, 271, __pyx_L3_error)
          for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
            if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__new__", 1, 3, 3, i); __PYX_ERR(0, 271, __pyx_L3_error) }
          }
        } else if (unlikely(__pyx_nargs != 3)) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
          if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 271, __pyx_L3_error)
          values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
          if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 271, __pyx_L3_error)
          values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
          if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 271, __pyx_L3_error)
        }
        __pyx_v_cls = values[0];
        __pyx_v_family = values[1];
        __pyx_v_iterable = values[2];
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__new__", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 271, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __Pyx_AddTraceback("gevent.resolver.cares.ares_host_result.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_16ares_host_result___new__(__pyx_self, __pyx_v_cls, __pyx_v_family, __pyx_v_iterable);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_16ares_host_result___new__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_family, PyObject *__pyx_v_iterable) {
      PyObject *__pyx_v_self = 0;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent.resolver.cares.ares_host_result.__new__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_self);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_1__new__, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_mstate_global->__pyx_n_u_ares_host_result___new, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 271, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_SetNewInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_new, __pyx_t_2) < 0) __PYX_ERR(0, 271, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +272:         cdef object self = tuple.__new__(cls, iterable)

      __pyx_t_2 = ((PyObject *)(&PyTuple_Type));
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_cls, __pyx_v_iterable};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_new, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 272, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_v_self = __pyx_t_1;
      __pyx_t_1 = 0;

    +273:         self.family = family

      if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_family, __pyx_v_family) < 0) __PYX_ERR(0, 273, __pyx_L1_error)

    +274:         return self

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self);
      __pyx_r = __pyx_v_self;
      goto __pyx_L0;

     275:

    +276:     def __getnewargs__(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__ = {"__getnewargs__", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__, METH_O, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__getnewargs__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_16ares_host_result_2__getnewargs__(__pyx_self, ((PyObject *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_16ares_host_result_2__getnewargs__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("gevent.resolver.cares.ares_host_result.__getnewargs__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_16ares_host_result_3__getnewargs__, 0, __pyx_mstate_global->__pyx_n_u_ares_host_result___getnewargs, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 276, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_getnewargs, __pyx_t_2) < 0) __PYX_ERR(0, 276, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +277:         return (self.family, tuple(self))

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_family); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PySequence_Tuple(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 277, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 277, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 277, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_2);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 277, __pyx_L1_error);
      __pyx_t_1 = 0;
      __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

     278:

     279:

    +280: cdef list _parse_h_aliases(hostent* host):

    static PyObject *__pyx_f_6gevent_8resolver_5cares__parse_h_aliases(struct hostent *__pyx_v_host) {
      PyObject *__pyx_v_result = 0;
      char **__pyx_v_aliases;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("gevent.resolver.cares._parse_h_aliases", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_result);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +281:     cdef list result = []

      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_result = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

    +282:     cdef char** aliases = host.h_aliases

      __pyx_t_2 = __pyx_v_host->h_aliases;
      __pyx_v_aliases = __pyx_t_2;

     283:

    +284:     if not aliases or not aliases[0]:

      __pyx_t_4 = (!(__pyx_v_aliases != 0));
      if (!__pyx_t_4) {
      } else {
        __pyx_t_3 = __pyx_t_4;
        goto __pyx_L4_bool_binop_done;
      }
      __pyx_t_4 = (!((__pyx_v_aliases[0]) != 0));
      __pyx_t_3 = __pyx_t_4;
      __pyx_L4_bool_binop_done:;
      if (__pyx_t_3) {
    /* … */
      }

    +285:         return result

        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_v_result);
        __pyx_r = __pyx_v_result;
        goto __pyx_L0;

     286:

    +287:     while aliases[0]: # *aliases

      while (1) {
        __pyx_t_3 = ((__pyx_v_aliases[0]) != 0);
        if (!__pyx_t_3) break;

     288:         # The old C version of this excluded an alias if

     289:         # it matched the host name. I don't think the stdlib does that?

    +290:         result.append(_as_str(aliases[0]))

        __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__as_str((__pyx_v_aliases[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 290, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +291:         aliases += 1

        __pyx_v_aliases = (__pyx_v_aliases + 1);
      }

    +292:     return result

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

     293:

     294:

    +295: cdef list _parse_h_addr_list(hostent* host):

    static PyObject *__pyx_f_6gevent_8resolver_5cares__parse_h_addr_list(struct hostent *__pyx_v_host) {
      PyObject *__pyx_v_result = 0;
      char **__pyx_v_addr_list;
      CYTHON_UNUSED int __pyx_v_addr_type;
      char __pyx_v_tmpbuf[46];
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_AddTraceback("gevent.resolver.cares._parse_h_addr_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_result);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +296:     cdef list result = []

      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_result = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

    +297:     cdef char** addr_list = host.h_addr_list

      __pyx_t_2 = __pyx_v_host->h_addr_list;
      __pyx_v_addr_list = __pyx_t_2;

    +298:     cdef int addr_type = host.h_addrtype

      __pyx_t_3 = __pyx_v_host->h_addrtype;
      __pyx_v_addr_type = __pyx_t_3;

     299:     # INET6_ADDRSTRLEN is 46, but we can't use that named constant

     300:     # here; cython doesn't like it.

     301:     cdef char tmpbuf[46]

     302:

    +303:     if not addr_list or not addr_list[0]:

      __pyx_t_5 = (!(__pyx_v_addr_list != 0));
      if (!__pyx_t_5) {
      } else {
        __pyx_t_4 = __pyx_t_5;
        goto __pyx_L4_bool_binop_done;
      }
      __pyx_t_5 = (!((__pyx_v_addr_list[0]) != 0));
      __pyx_t_4 = __pyx_t_5;
      __pyx_L4_bool_binop_done:;
      if (__pyx_t_4) {
    /* … */
      }

    +304:         return result

        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_v_result);
        __pyx_r = __pyx_v_result;
        goto __pyx_L0;

     305:

    +306:     while addr_list[0]:

      while (1) {
        __pyx_t_4 = ((__pyx_v_addr_list[0]) != 0);
        if (!__pyx_t_4) break;

    +307:         if not cares.ares_inet_ntop(host.h_addrtype, addr_list[0], tmpbuf, INET6_ADDRSTRLEN):

        __pyx_t_4 = (!(ares_inet_ntop(__pyx_v_host->h_addrtype, (__pyx_v_addr_list[0]), __pyx_v_tmpbuf, INET6_ADDRSTRLEN) != 0));
        if (unlikely(__pyx_t_4)) {
    /* … */
        }

    +308:             raise _socket.error("Failed in ares_inet_ntop")

          __pyx_t_6 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_socket); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 308, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_error); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 308, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_9 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_8))) {
            __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
            assert(__pyx_t_6);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_6);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
            __pyx_t_9 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_mstate_global->__pyx_kp_u_Failed_in_ares_inet_ntop};
            __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 308, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_1);
          }
          __Pyx_Raise(__pyx_t_1, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __PYX_ERR(0, 308, __pyx_L1_error)

     309:

    +310:         result.append(_as_str(tmpbuf))

        __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_tmpbuf); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 310, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 310, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +311:         addr_list += 1

        __pyx_v_addr_list = (__pyx_v_addr_list + 1);
      }

     312:

    +313:     return result

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_result);
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

     314:

     315:

    +316: cdef object _as_str(const char* val):

    static PyObject *__pyx_f_6gevent_8resolver_5cares__as_str(char const *__pyx_v_val) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("gevent.resolver.cares._as_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +317:     if not val:

      __pyx_t_1 = (!(__pyx_v_val != 0));
      if (__pyx_t_1) {
    /* … */
      }

    +318:         return None

        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L0;

    +319:     return val.decode('utf-8')

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_ssize_strlen(__pyx_v_val); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 319, __pyx_L1_error)
      __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_val, 0, __pyx_t_2, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

     320:

     321:

    +322: cdef void gevent_ares_nameinfo_callback(void *arg, int status, int timeouts, char *c_node, char *c_service):

    static void __pyx_f_6gevent_8resolver_5cares_gevent_ares_nameinfo_callback(void *__pyx_v_arg, int __pyx_v_status, CYTHON_UNUSED int __pyx_v_timeouts, char *__pyx_v_c_node, char *__pyx_v_c_service) {
      struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_channel = 0;
      PyObject *__pyx_v_callback = 0;
      PyObject *__pyx_v_node = 0;
      PyObject *__pyx_v_service = 0;
    /* … */
      /* function exit code */
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_13);
      __Pyx_XDECREF(__pyx_t_14);
      __Pyx_AddTraceback("gevent.resolver.cares.gevent_ares_nameinfo_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_L0:;
      __Pyx_XDECREF((PyObject *)__pyx_v_channel);
      __Pyx_XDECREF(__pyx_v_callback);
      __Pyx_XDECREF(__pyx_v_node);
      __Pyx_XDECREF(__pyx_v_service);
      __Pyx_RefNannyFinishContext();
    }

     323:     cdef channel channel

     324:     cdef object callback

    +325:     channel, callback = <tuple>arg

      __pyx_t_1 = ((PyObject *)__pyx_v_arg);
      __Pyx_INCREF(__pyx_t_1);
      if (likely(__pyx_t_1 != Py_None)) {
        PyObject* sequence = __pyx_t_1;
        Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 325, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_3);
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 325, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 325, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 325, __pyx_L1_error)
      }
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel))))) __PYX_ERR(0, 325, __pyx_L1_error)
      __pyx_v_channel = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_v_callback = __pyx_t_3;
      __pyx_t_3 = 0;

    +326:     Py_DECREF(<tuple>arg)

      Py_DECREF(((PyObject *)__pyx_v_arg));

     327:     cdef object node

     328:     cdef object service

    +329:     try:

      {
        /*try:*/ {
    /* … */
        }
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L8_try_end;
        __pyx_L3_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    /* … */
        __pyx_L5_except_error:;
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L1_error;
        __pyx_L4_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        __pyx_L8_try_end:;
      }

    +330:         if status:

          __pyx_t_7 = (__pyx_v_status != 0);
          if (__pyx_t_7) {
    /* … */
            goto __pyx_L9;
          }

    +331:             callback(Result(None, _gevent_gaierror_from_status(status)))

            __pyx_t_3 = NULL;
            __Pyx_INCREF(__pyx_v_callback);
            __pyx_t_2 = __pyx_v_callback;
            __pyx_t_9 = NULL;
            __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_Result);
            __pyx_t_10 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_Result);
            __pyx_t_11 = __pyx_f_6gevent_8resolver_5cares__gevent_gaierror_from_status(__pyx_v_status); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 331, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_12 = 1;
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_9, Py_None, __pyx_t_11};
              __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 331, __pyx_L3_error)
              __Pyx_GOTREF((PyObject *)__pyx_t_8);
            }
            __pyx_t_12 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_2))) {
              __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
              assert(__pyx_t_3);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
              __pyx_t_12 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_t_8)};
              __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_1);
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     332:         else:

    +333:             node = _as_str(c_node)

          /*else*/ {
            __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_c_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_v_node = __pyx_t_1;
            __pyx_t_1 = 0;

    +334:             service = _as_str(c_service)

            __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_c_service); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 334, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_v_service = __pyx_t_1;
            __pyx_t_1 = 0;

    +335:             callback(Result((node, service)))

            __pyx_t_2 = NULL;
            __Pyx_INCREF(__pyx_v_callback);
            __pyx_t_8 = __pyx_v_callback;
            __pyx_t_10 = NULL;
            __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_Result);
            __pyx_t_11 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_Result);
            __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 335, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_INCREF(__pyx_v_node);
            __Pyx_GIVEREF(__pyx_v_node);
            if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_node) != (0)) __PYX_ERR(0, 335, __pyx_L3_error);
            __Pyx_INCREF(__pyx_v_service);
            __Pyx_GIVEREF(__pyx_v_service);
            if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_service) != (0)) __PYX_ERR(0, 335, __pyx_L3_error);
            __pyx_t_12 = 1;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_9};
              __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
              if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 335, __pyx_L3_error)
              __Pyx_GOTREF((PyObject *)__pyx_t_3);
            }
            __pyx_t_12 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_8))) {
              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_8);
              assert(__pyx_t_2);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_8);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_8, __pyx__function);
              __pyx_t_12 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_t_3)};
              __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_DECREF((PyObject *)__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_1);
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __pyx_L9:;

    +336:     except:

        /*except:*/ {
          __Pyx_AddTraceback("gevent.resolver.cares.gevent_ares_nameinfo_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_3) < 0) __PYX_ERR(0, 336, __pyx_L5_except_error)
          __Pyx_XGOTREF(__pyx_t_1);
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_3);

    +337:         channel.loop.handle_error(callback, *sys.exc_info())

          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_channel->loop, __pyx_mstate_global->__pyx_n_u_handle_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 337, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_INCREF(__pyx_v_callback);
          __Pyx_GIVEREF(__pyx_v_callback);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_callback) != (0)) __PYX_ERR(0, 337, __pyx_L5_except_error);
          __pyx_t_10 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 337, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_exc_info); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 337, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_12 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_14))) {
            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_14);
            assert(__pyx_t_10);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
            __pyx_t_12 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
            __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+__pyx_t_12, (1-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 337, __pyx_L5_except_error)
            __Pyx_GOTREF(__pyx_t_9);
          }
          __pyx_t_14 = __Pyx_PySequence_Tuple(__pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 337, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_9 = PyNumber_Add(__pyx_t_11, __pyx_t_14); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 337, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 337, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L4_exception_handled;
        }

     338:

     339:

     340:

    +341: cdef int _make_sockaddr(const char* hostp, int port, int flowinfo, int scope_id, sockaddr_in6* sa6):

    static int __pyx_f_6gevent_8resolver_5cares__make_sockaddr(char const *__pyx_v_hostp, int __pyx_v_port, int __pyx_v_flowinfo, int __pyx_v_scope_id, struct sockaddr_in6 *__pyx_v_sa6) {
      int __pyx_r;
    /* … */
      /* function exit code */
      __pyx_L0:;
      return __pyx_r;
    }

    +342:     if cares.ares_inet_pton(AF_INET, hostp, &(<sockaddr_in*>sa6).sin_addr.s_addr) > 0:

      __pyx_t_1 = (ares_inet_pton(AF_INET, __pyx_v_hostp, (&((struct sockaddr_in *)__pyx_v_sa6)->sin_addr.s_addr)) > 0);
      if (__pyx_t_1) {
    /* … */
      }

    +343:         (<sockaddr_in*>sa6).sin_family = AF_INET

        ((struct sockaddr_in *)__pyx_v_sa6)->sin_family = AF_INET;

    +344:         (<sockaddr_in*>sa6).sin_port = htons(port)

        ((struct sockaddr_in *)__pyx_v_sa6)->sin_port = htons(__pyx_v_port);

    +345:         return sizeof(sockaddr_in)

        __pyx_r = (sizeof(struct sockaddr_in));
        goto __pyx_L0;

     346:

    +347:     if cares.ares_inet_pton(AF_INET6, hostp, &(sa6.sin6_addr).s6_addr) > 0:

      __pyx_t_1 = (ares_inet_pton(AF_INET6, __pyx_v_hostp, (&__pyx_v_sa6->sin6_addr.s6_addr)) > 0);
      if (__pyx_t_1) {
    /* … */
      }

    +348:         sa6.sin6_family = AF_INET6

        __pyx_v_sa6->sin6_family = AF_INET6;

    +349:         sa6.sin6_port = htons(port)

        __pyx_v_sa6->sin6_port = htons(__pyx_v_port);

    +350:         sa6.sin6_flowinfo = flowinfo

        __pyx_v_sa6->sin6_flowinfo = __pyx_v_flowinfo;

    +351:         sa6.sin6_scope_id = scope_id

        __pyx_v_sa6->sin6_scope_id = __pyx_v_scope_id;

    +352:         return sizeof(sockaddr_in6);

        __pyx_r = (sizeof(struct sockaddr_in6));
        goto __pyx_L0;

     353:

    +354:     return -1;

      __pyx_r = -1;
      goto __pyx_L0;

     355:

     356:

    +357: cdef class channel:

    struct __pyx_obj_6gevent_8resolver_5cares_channel {
      PyObject_HEAD
      struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *__pyx_vtab;
      struct ares_channeldata *channel;
      PyObject *loop;
      PyObject *_watchers;
      PyObject *_timer;
    };

    struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel {
      PyObject *(*_channel__destroy)(struct __pyx_obj_6gevent_8resolver_5cares_channel *);
      PyObject *(*set_servers)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers *__pyx_optional_args);
      PyObject *(*_sock_state_callback)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, int, int, int);
      void (*_gethostbyname_or_byaddr_cb)(void *, int, int, struct hostent *);
      PyObject *(*_getnameinfo)(struct __pyx_obj_6gevent_8resolver_5cares_channel *, PyObject *, PyObject *, int, int __pyx_skip_dispatch);
      int (*_convert_cares_ni_flags)(int);
      int (*_convert_cares_ai_flags)(int);
      void (*_getaddrinfo_cb)(void *, int, int, struct ares_addrinfo *);
    };
    static struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *__pyx_vtabptr_6gevent_8resolver_5cares_channel;

     358:     cdef ares_channeldata* channel

     359:

    +360:     cdef readonly object loop

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_4loop_1__get__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_4loop___get__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_4loop___get__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self->loop);
      __pyx_r = __pyx_v_self->loop;
      goto __pyx_L0;

     361:

     362:     cdef dict _watchers

     363:     cdef object _timer

     364:

    +365:     def __init__(self, object loop, flags=None, timeout=None, tries=None, ndots=None,

    /* Python wrapper */
    static int __pyx_pw_6gevent_8resolver_5cares_7channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static int __pyx_pw_6gevent_8resolver_5cares_7channel_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      PyObject *__pyx_v_loop = 0;
      PyObject *__pyx_v_flags = 0;
      PyObject *__pyx_v_timeout = 0;
      PyObject *__pyx_v_tries = 0;
      PyObject *__pyx_v_ndots = 0;
      PyObject *__pyx_v_udp_port = 0;
      PyObject *__pyx_v_tcp_port = 0;
      PyObject *__pyx_v_servers = 0;
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
      #endif
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      {
        PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_loop,&__pyx_mstate_global->__pyx_n_u_flags,&__pyx_mstate_global->__pyx_n_u_timeout,&__pyx_mstate_global->__pyx_n_u_tries,&__pyx_mstate_global->__pyx_n_u_ndots,&__pyx_mstate_global->__pyx_n_u_udp_port,&__pyx_mstate_global->__pyx_n_u_tcp_port,&__pyx_mstate_global->__pyx_n_u_servers,0};
      PyObject* values[8] = {0,0,0,0,0,0,0,0};
        const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
        if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 365, __pyx_L3_error)
        if (__pyx_kwds_len > 0) {
          switch (__pyx_nargs) {
            case  8:
            values[7] = __Pyx_ArgRef_VARARGS(__pyx_args, 7);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 365, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  7:
            values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 365, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  6:
            values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 365, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  5:
            values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 365, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  4:
            values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 365, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  3:
            values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 365, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  2:
            values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 365, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  1:
            values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 365, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          const Py_ssize_t kwd_pos_args = __pyx_nargs;
          if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 365, __pyx_L3_error)
          if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
          if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
          if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
          if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    /* … */
          if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
          if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
          if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
          if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    /* … */
      /* function exit code */
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static int __pyx_pf_6gevent_8resolver_5cares_7channel___init__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_loop, PyObject *__pyx_v_flags, PyObject *__pyx_v_timeout, PyObject *__pyx_v_tries, PyObject *__pyx_v_ndots, PyObject *__pyx_v_udp_port, PyObject *__pyx_v_tcp_port, PyObject *__pyx_v_servers) {
      struct ares_channeldata *__pyx_v_channel;
      struct ares_options __pyx_v_options;
      int __pyx_v_optmask;
      int __pyx_v_result;
      int __pyx_r;
    /* … */
      /* function exit code */
      __pyx_r = 0;
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_10);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = -1;
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +366:                  udp_port=None, tcp_port=None, servers=None):

          if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
          if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None));
          if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)Py_None));
          for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
            if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 8, i); __PYX_ERR(0, 365, __pyx_L3_error) }
          }
        } else {
          switch (__pyx_nargs) {
            case  8:
            values[7] = __Pyx_ArgRef_VARARGS(__pyx_args, 7);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 365, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  7:
            values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 365, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  6:
            values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 365, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  5:
            values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 365, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  4:
            values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 365, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  3:
            values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 365, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  2:
            values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 365, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  1:
            values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 365, __pyx_L3_error)
            break;
            default: goto __pyx_L5_argtuple_error;
          }
    /* … */
          if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
          if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None));
          if (!values[7]) values[7] = __Pyx_NewRef(((PyObject *)Py_None));
        }
        __pyx_v_loop = values[0];
        __pyx_v_flags = values[1];
        __pyx_v_timeout = values[2];
        __pyx_v_tries = values[3];
        __pyx_v_ndots = values[4];
        __pyx_v_udp_port = values[5];
        __pyx_v_tcp_port = values[6];
        __pyx_v_servers = values[7];
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 8, __pyx_nargs); __PYX_ERR(0, 365, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __Pyx_AddTraceback("gevent.resolver.cares.channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return -1;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel___init__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_loop, __pyx_v_flags, __pyx_v_timeout, __pyx_v_tries, __pyx_v_ndots, __pyx_v_udp_port, __pyx_v_tcp_port, __pyx_v_servers);

    +367:         cdef ares_channeldata* channel = NULL

      __pyx_v_channel = NULL;

     368:         cdef cares.ares_options options

    +369:         memset(&options, 0, sizeof(cares.ares_options))

      (void)(memset((&__pyx_v_options), 0, (sizeof(struct ares_options))));

    +370:         cdef int optmask = cares.ARES_OPT_SOCK_STATE_CB

      __pyx_v_optmask = ARES_OPT_SOCK_STATE_CB;

     371:

    +372:         options.sock_state_cb = <void*>gevent_sock_state_callback

      __pyx_v_options.sock_state_cb = ((void *)__pyx_f_6gevent_8resolver_5cares_gevent_sock_state_callback);

    +373:         options.sock_state_cb_data = <void*>self

      __pyx_v_options.sock_state_cb_data = ((void *)__pyx_v_self);

     374:

    +375:         if flags is not None:

      __pyx_t_1 = (__pyx_v_flags != Py_None);
      if (__pyx_t_1) {
    /* … */
      }

    +376:             options.flags = int(flags)

        __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 376, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 376, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_options.flags = __pyx_t_3;

    +377:             optmask |= cares.ARES_OPT_FLAGS

        __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_FLAGS);

     378:

    +379:         if timeout is not None:

      __pyx_t_1 = (__pyx_v_timeout != Py_None);
      if (__pyx_t_1) {
    /* … */
      }

    +380:             options.timeout = int(float(timeout) * 1000)

        __pyx_t_4 = __Pyx_PyObject_AsDouble(__pyx_v_timeout); if (unlikely(__pyx_t_4 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 380, __pyx_L1_error)
        __pyx_v_options.timeout = ((int)(__pyx_t_4 * 1000.0));

    +381:             optmask |= cares.ARES_OPT_TIMEOUTMS

        __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_TIMEOUTMS);

     382:

    +383:         if tries is not None:

      __pyx_t_1 = (__pyx_v_tries != Py_None);
      if (__pyx_t_1) {
    /* … */
      }

    +384:             options.tries = int(tries)

        __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_tries); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 384, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_options.tries = __pyx_t_3;

    +385:             optmask |= cares.ARES_OPT_TRIES

        __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_TRIES);

     386:

    +387:         if ndots is not None:

      __pyx_t_1 = (__pyx_v_ndots != Py_None);
      if (__pyx_t_1) {
    /* … */
      }

    +388:             options.ndots = int(ndots)

        __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_ndots); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 388, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 388, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_options.ndots = __pyx_t_3;

    +389:             optmask |= cares.ARES_OPT_NDOTS

        __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_NDOTS);

     390:

    +391:         if udp_port is not None:

      __pyx_t_1 = (__pyx_v_udp_port != Py_None);
      if (__pyx_t_1) {
    /* … */
      }

    +392:             options.udp_port = int(udp_port)

        __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_udp_port); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = __Pyx_PyLong_As_unsigned_short(__pyx_t_2); if (unlikely((__pyx_t_5 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(0, 392, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_options.udp_port = __pyx_t_5;

    +393:             optmask |= cares.ARES_OPT_UDP_PORT

        __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_UDP_PORT);

     394:

    +395:         if tcp_port is not None:

      __pyx_t_1 = (__pyx_v_tcp_port != Py_None);
      if (__pyx_t_1) {
    /* … */
      }

    +396:             options.tcp_port = int(tcp_port)

        __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_tcp_port); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_5 = __Pyx_PyLong_As_unsigned_short(__pyx_t_2); if (unlikely((__pyx_t_5 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(0, 396, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_v_options.tcp_port = __pyx_t_5;

    +397:             optmask |= cares.ARES_OPT_TCP_PORT

        __pyx_v_optmask = (__pyx_v_optmask | ARES_OPT_TCP_PORT);

     398:

    +399:         cdef int result = cares.ares_library_init(cares.ARES_LIB_INIT_ALL)  # ARES_LIB_INIT_WIN32 -DUSE_WINSOCK?

      __pyx_v_result = ares_library_init(ARES_LIB_INIT_ALL);

    +400:         if result:

      __pyx_t_1 = (__pyx_v_result != 0);
      if (unlikely(__pyx_t_1)) {
    /* … */
      }

    +401:             raise gaierror(result, _gevent_gai_strerror(result))

        __pyx_t_6 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_gaierror); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 401, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 401, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = __Pyx_PyLong_From_int(__pyx_v_result); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 401, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = __pyx_f_6gevent_8resolver_5cares__gevent_gai_strerror(__pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 401, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_11 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
          assert(__pyx_t_6);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
          __pyx_t_11 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_8, __pyx_t_10};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 401, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 401, __pyx_L1_error)

    +402:         result = cares.ares_init_options(&channel, &options, optmask)

      __pyx_v_result = ares_init_options((&__pyx_v_channel), (&__pyx_v_options), __pyx_v_optmask);

    +403:         if result:

      __pyx_t_1 = (__pyx_v_result != 0);
      if (unlikely(__pyx_t_1)) {
    /* … */
      }

    +404:             raise gaierror(result, _gevent_gai_strerror(result))

        __pyx_t_7 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_mstate_global->__pyx_n_u_gaierror); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 404, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_8 = __Pyx_PyLong_From_int(__pyx_v_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 404, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_6 = __Pyx_PyLong_From_int(__pyx_v_result); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 404, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_9 = __pyx_f_6gevent_8resolver_5cares__gevent_gai_strerror(__pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 404, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_11 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_10);
          assert(__pyx_t_7);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
          __pyx_t_11 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_t_8, __pyx_t_9};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 404, __pyx_L1_error)

    +405:         self._timer = loop.timer(TIMEOUT, TIMEOUT)

      __pyx_t_10 = __pyx_v_loop;
      __Pyx_INCREF(__pyx_t_10);
      __pyx_t_9 = __Pyx_PyLong_From_int(TIMEOUT); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 405, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_8 = __Pyx_PyLong_From_int(TIMEOUT); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 405, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_11 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_t_9, __pyx_t_8};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_timer, __pyx_callargs+__pyx_t_11, (3-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 405, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->_timer);
      __Pyx_DECREF(__pyx_v_self->_timer);
      __pyx_v_self->_timer = __pyx_t_2;
      __pyx_t_2 = 0;

    +406:         self._watchers = {}

      __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 406, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->_watchers);
      __Pyx_DECREF(__pyx_v_self->_watchers);
      __pyx_v_self->_watchers = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;

    +407:         self.channel = channel

      __pyx_v_self->channel = __pyx_v_channel;

    +408:         try:

      {
        /*try:*/ {
    /* … */
        }
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        goto __pyx_L16_try_end;
        __pyx_L11_error:;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    /* … */
        __pyx_L13_except_error:;
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
        goto __pyx_L1_error;
        __pyx_L16_try_end:;
      }

    +409:             if servers is not None:

          __pyx_t_1 = (__pyx_v_servers != Py_None);
          if (__pyx_t_1) {
    /* … */
          }

    +410:                 self.set_servers(servers)

            __pyx_t_15.__pyx_n = 1;
            __pyx_t_15.servers = __pyx_v_servers;
            __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *)__pyx_v_self->__pyx_vtab)->set_servers(__pyx_v_self, 0, &__pyx_t_15); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 410, __pyx_L11_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +411:             self.loop = loop

          __Pyx_INCREF(__pyx_v_loop);
          __Pyx_GIVEREF(__pyx_v_loop);
          __Pyx_GOTREF(__pyx_v_self->loop);
          __Pyx_DECREF(__pyx_v_self->loop);
          __pyx_v_self->loop = __pyx_v_loop;

    +412:         except:

        /*except:*/ {
          __Pyx_AddTraceback("gevent.resolver.cares.channel.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_8, &__pyx_t_9) < 0) __PYX_ERR(0, 412, __pyx_L13_except_error)
          __Pyx_XGOTREF(__pyx_t_2);
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_9);

    +413:             self.destroy()

          __pyx_t_7 = ((PyObject *)__pyx_v_self);
          __Pyx_INCREF(__pyx_t_7);
          __pyx_t_11 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_7, NULL};
            __pyx_t_10 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_destroy, __pyx_callargs+__pyx_t_11, (1-__pyx_t_11) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 413, __pyx_L13_except_error)
            __Pyx_GOTREF(__pyx_t_10);
          }
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    +414:             raise

          __Pyx_GIVEREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_8, __pyx_t_9);
          __pyx_t_2 = 0;  __pyx_t_8 = 0;  __pyx_t_9 = 0;
          __PYX_ERR(0, 414, __pyx_L13_except_error)
        }

     415:

    +416:     def __repr__(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_3__repr__(PyObject *__pyx_v_self); /*proto*/
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_3__repr__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_2__repr__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_2__repr__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
      PyObject *__pyx_v_args = NULL;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_args);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +417:         args = (self.__class__.__name__, id(self), self._timer, len(self._watchers))

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 417, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_builtin_id);
      __pyx_t_4 = __pyx_builtin_id;
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self)};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_t_4 = __pyx_v_self->_watchers;
      __Pyx_INCREF(__pyx_t_4);
      if (unlikely(__pyx_t_4 == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 417, __pyx_L1_error)
      }
      __pyx_t_6 = PyDict_Size(__pyx_t_4); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 417, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyLong_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 417, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 417, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_2);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 417, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_1);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1) != (0)) __PYX_ERR(0, 417, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_self->_timer);
      __Pyx_GIVEREF(__pyx_v_self->_timer);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_self->_timer) != (0)) __PYX_ERR(0, 417, __pyx_L1_error);
      __Pyx_GIVEREF(__pyx_t_4);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_t_4) != (0)) __PYX_ERR(0, 417, __pyx_L1_error);
      __pyx_t_2 = 0;
      __pyx_t_1 = 0;
      __pyx_t_4 = 0;
      __pyx_v_args = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;

    +418:         return '<%s at 0x%x _timer=%r _watchers[%s]>' % args

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = PyUnicode_Format(__pyx_mstate_global->__pyx_kp_u_s_at_0x_x__timer_r__watchers_s, __pyx_v_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 418, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

     419:

    +420:     def destroy(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_5destroy = {"destroy", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_7channel_5destroy, METH_NOARGS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("destroy (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_4destroy(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_4destroy(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_5destroy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_channel_destroy, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel, __pyx_mstate_global->__pyx_n_u_destroy, __pyx_t_5) < 0) __PYX_ERR(0, 420, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    +421:         self.__destroy()

      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *)__pyx_v_self->__pyx_vtab)->_channel__destroy(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     422:

    +423:     cdef __destroy(self):

    static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel__channel__destroy(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_AddTraceback("gevent.resolver.cares.channel._channel__destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +424:         if self.channel:

      __pyx_t_1 = (__pyx_v_self->channel != 0);
      if (__pyx_t_1) {
    /* … */
      }

     425:             # XXX ares_library_cleanup?

    +426:             cares.ares_destroy(self.channel)

        ares_destroy(__pyx_v_self->channel);

    +427:             self.channel = NULL

        __pyx_v_self->channel = NULL;

    +428:             self._watchers.clear()

        if (unlikely(__pyx_v_self->_watchers == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "clear");
          __PYX_ERR(0, 428, __pyx_L1_error)
        }
        __pyx_t_2 = __Pyx_PyDict_Clear(__pyx_v_self->_watchers); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 428, __pyx_L1_error)

    +429:             self._timer.stop()

        __pyx_t_4 = __pyx_v_self->_timer;
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, NULL};
          __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_stop, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +430:             self.loop = None

        __Pyx_INCREF(Py_None);
        __Pyx_GIVEREF(Py_None);
        __Pyx_GOTREF(__pyx_v_self->loop);
        __Pyx_DECREF(__pyx_v_self->loop);
        __pyx_v_self->loop = Py_None;

     431:

    +432:     def __dealloc__(self):

    /* Python wrapper */
    static void __pyx_pw_6gevent_8resolver_5cares_7channel_7__dealloc__(PyObject *__pyx_v_self); /*proto*/
    static void __pyx_pw_6gevent_8resolver_5cares_7channel_7__dealloc__(PyObject *__pyx_v_self) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_pf_6gevent_8resolver_5cares_7channel_6__dealloc__(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
    }

    static void __pyx_pf_6gevent_8resolver_5cares_7channel_6__dealloc__(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
    /* … */
      /* function exit code */
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_WriteUnraisable("gevent.resolver.cares.channel.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
    }

    +433:         self.__destroy()

      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *)__pyx_v_self->__pyx_vtab)->_channel__destroy(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 433, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     434:

    +435:     cpdef set_servers(self, servers=None):

    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel_set_servers(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers *__pyx_optional_args) {
      PyObject *__pyx_v_servers = ((PyObject *)Py_None);
      int __pyx_v_length;
      CYTHON_UNUSED int __pyx_v_result;
      int __pyx_v_index;
      char *__pyx_v_string;
      struct ares_addr_node *__pyx_v_c_servers;
      PyObject *__pyx_v_server = NULL;
      PyObject *__pyx_r = NULL;
      if (__pyx_optional_args) {
        if (__pyx_optional_args->__pyx_n > 0) {
          __pyx_v_servers = __pyx_optional_args->servers;
        }
      }
      __Pyx_INCREF(__pyx_v_servers);
      /* Check if called by wrapper */
      if (unlikely(__pyx_skip_dispatch)) ;
      /* Check if overridden in Python */
      else if (
      #if !CYTHON_USE_TYPE_SLOTS
      unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel &&
      __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
      #else
      unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
      #endif
      ) {
        #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
        if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
          PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          #endif
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_set_servers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers)) {
            __Pyx_XDECREF(__pyx_r);
            __pyx_t_3 = NULL;
            __Pyx_INCREF(__pyx_t_1);
            __pyx_t_4 = __pyx_t_1;
            __pyx_t_5 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_4))) {
              __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
              assert(__pyx_t_3);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
              __pyx_t_5 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_servers};
              __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 435, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
            }
            __pyx_r = __pyx_t_2;
            __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            goto __pyx_L0;
          }
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
          __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
          if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
            __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
          }
          #endif
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        }
        #endif
      }
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_12);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.set_servers", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_server);
      __Pyx_XDECREF(__pyx_v_servers);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_9set_servers = {"set_servers", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_9set_servers(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_servers = 0;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("set_servers (wrapper)", 0);
      #if !CYTHON_METH_FASTCALL
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      #endif
      __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      {
        PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_servers,0};
      PyObject* values[1] = {0};
        const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
        if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 435, __pyx_L3_error)
        if (__pyx_kwds_len > 0) {
          switch (__pyx_nargs) {
            case  1:
            values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 435, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          const Py_ssize_t kwd_pos_args = __pyx_nargs;
          if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_servers", 0) < 0) __PYX_ERR(0, 435, __pyx_L3_error)
          if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
        } else {
          switch (__pyx_nargs) {
            case  1:
            values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 435, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
        }
        __pyx_v_servers = values[0];
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("set_servers", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 435, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __Pyx_AddTraceback("gevent.resolver.cares.channel.set_servers", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_8set_servers(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_servers);

      /* function exit code */
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_8set_servers(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_servers) {
      PyObject *__pyx_r = NULL;
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2.__pyx_n = 1;
      __pyx_t_2.servers = __pyx_v_servers;
      __pyx_t_1 = __pyx_vtabptr_6gevent_8resolver_5cares_channel->set_servers(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.set_servers", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_9set_servers, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_channel_set_servers, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 435, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[2]);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel, __pyx_mstate_global->__pyx_n_u_set_servers, __pyx_t_5) < 0) __PYX_ERR(0, 435, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    /* … */
      __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 435, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);
    /* … */
    struct __pyx_opt_args_6gevent_8resolver_5cares_7channel_set_servers {
      int __pyx_n;
      PyObject *servers;
    };

    +436:         if not self.channel:

      __pyx_t_6 = (!(__pyx_v_self->channel != 0));
      if (unlikely(__pyx_t_6)) {
    /* … */
      }

    +437:             raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed')

        __pyx_t_2 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_gaierror); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 437, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_PyLong_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 437, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_2);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_3, __pyx_mstate_global->__pyx_kp_u_this_ares_channel_has_been_destr};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 437, __pyx_L1_error)

    +438:         if not servers:

      __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_servers); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 438, __pyx_L1_error)
      __pyx_t_7 = (!__pyx_t_6);
      if (__pyx_t_7) {
    /* … */
      }

    +439:             servers = []

        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF_SET(__pyx_v_servers, __pyx_t_1);
        __pyx_t_1 = 0;

    +440:         if isinstance(servers, str):

      __pyx_t_7 = PyUnicode_Check(__pyx_v_servers);
      if (__pyx_t_7) {
    /* … */
      }

    +441:             servers = servers.split(',')

        __pyx_t_4 = __pyx_v_servers;
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u__4};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_split, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 441, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_DECREF_SET(__pyx_v_servers, __pyx_t_1);
        __pyx_t_1 = 0;

    +442:         cdef int length = len(servers)

      __pyx_t_8 = PyObject_Length(__pyx_v_servers); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 442, __pyx_L1_error)
      __pyx_v_length = __pyx_t_8;

     443:         cdef int result, index

     444:         cdef char* string

     445:         cdef cares.ares_addr_node* c_servers

    +446:         if length <= 0:

      __pyx_t_7 = (__pyx_v_length <= 0);
      if (__pyx_t_7) {
    /* … */
        goto __pyx_L6;
      }

    +447:             result = cares.ares_set_servers(self.channel, NULL)

        __pyx_v_result = ares_set_servers(__pyx_v_self->channel, NULL);

     448:         else:

    +449:             c_servers = <cares.ares_addr_node*>PyMem_Malloc(sizeof(cares.ares_addr_node) * length)

      /*else*/ {
        __pyx_v_c_servers = ((struct ares_addr_node *)PyMem_Malloc(((sizeof(struct ares_addr_node)) * __pyx_v_length)));

    +450:             if not c_servers:

        __pyx_t_7 = (!(__pyx_v_c_servers != 0));
        if (unlikely(__pyx_t_7)) {
    /* … */
        }

    +451:                 raise MemoryError

          PyErr_NoMemory(); __PYX_ERR(0, 451, __pyx_L1_error)

    +452:             try:

        /*try:*/ {

    +453:                 index = 0

          __pyx_v_index = 0;

    +454:                 for server in servers:

          if (likely(PyList_CheckExact(__pyx_v_servers)) || PyTuple_CheckExact(__pyx_v_servers)) {
            __pyx_t_1 = __pyx_v_servers; __Pyx_INCREF(__pyx_t_1);
            __pyx_t_8 = 0;
            __pyx_t_9 = NULL;
          } else {
            __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_servers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 454, __pyx_L9_error)
          }
          for (;;) {
            if (likely(!__pyx_t_9)) {
              if (likely(PyList_CheckExact(__pyx_t_1))) {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 454, __pyx_L9_error)
                  #endif
                  if (__pyx_t_8 >= __pyx_temp) break;
                }
                __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_8);
                ++__pyx_t_8;
              } else {
                {
                  Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
                  #if !CYTHON_ASSUME_SAFE_SIZE
                  if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 454, __pyx_L9_error)
                  #endif
                  if (__pyx_t_8 >= __pyx_temp) break;
                }
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8));
                #else
                __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_8);
                #endif
                ++__pyx_t_8;
              }
              if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 454, __pyx_L9_error)
            } else {
              __pyx_t_4 = __pyx_t_9(__pyx_t_1);
              if (unlikely(!__pyx_t_4)) {
                PyObject* exc_type = PyErr_Occurred();
                if (exc_type) {
                  if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 454, __pyx_L9_error)
                  PyErr_Clear();
                }
                break;
              }
            }
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_XDECREF_SET(__pyx_v_server, __pyx_t_4);
            __pyx_t_4 = 0;
    /* … */
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L16_for_end;
          __pyx_L12_break:;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L16_for_end;
          __pyx_L16_for_end:;

    +455:                     if isinstance(server, unicode):

            __pyx_t_7 = PyUnicode_Check(__pyx_v_server);
            if (__pyx_t_7) {
    /* … */
            }

    +456:                         server = server.encode('ascii')

              __pyx_t_3 = __pyx_v_server;
              __Pyx_INCREF(__pyx_t_3);
              __pyx_t_5 = 0;
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ascii};
                __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_encode, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 456, __pyx_L9_error)
                __Pyx_GOTREF(__pyx_t_4);
              }
              __Pyx_DECREF_SET(__pyx_v_server, __pyx_t_4);
              __pyx_t_4 = 0;

    +457:                     string = <char*?>server

            __pyx_t_10 = __Pyx_PyObject_AsWritableString(__pyx_v_server); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 457, __pyx_L9_error)
            __pyx_v_string = ((char *)__pyx_t_10);

    +458:                     if cares.ares_inet_pton(AF_INET, string, &c_servers[index].addr) > 0:

            __pyx_t_7 = (ares_inet_pton(AF_INET, __pyx_v_string, (&(__pyx_v_c_servers[__pyx_v_index]).addr)) > 0);
            if (__pyx_t_7) {
    /* … */
              goto __pyx_L14;
            }

    +459:                         c_servers[index].family = AF_INET

              (__pyx_v_c_servers[__pyx_v_index]).family = AF_INET;

    +460:                     elif cares.ares_inet_pton(AF_INET6, string, &c_servers[index].addr) > 0:

            __pyx_t_7 = (ares_inet_pton(AF_INET6, __pyx_v_string, (&(__pyx_v_c_servers[__pyx_v_index]).addr)) > 0);
            if (likely(__pyx_t_7)) {
    /* … */
              goto __pyx_L14;
            }

    +461:                         c_servers[index].family = AF_INET6

              (__pyx_v_c_servers[__pyx_v_index]).family = AF_INET6;

     462:                     else:

    +463:                         raise InvalidIP(repr(string))

            /*else*/ {
              __pyx_t_3 = NULL;
              __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_InvalidIP); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 463, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_2);
              __pyx_t_11 = __Pyx_PyBytes_FromString(__pyx_v_string); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 463, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_12 = PyObject_Repr(__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 463, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_12);
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
              __pyx_t_5 = 1;
              #if CYTHON_UNPACK_METHODS
              if (unlikely(PyMethod_Check(__pyx_t_2))) {
                __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
                assert(__pyx_t_3);
                PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
                __Pyx_INCREF(__pyx_t_3);
                __Pyx_INCREF(__pyx__function);
                __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
                __pyx_t_5 = 0;
              }
              #endif
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_12};
                __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 463, __pyx_L9_error)
                __Pyx_GOTREF(__pyx_t_4);
              }
              __Pyx_Raise(__pyx_t_4, 0, 0, 0);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __PYX_ERR(0, 463, __pyx_L9_error)
            }
            __pyx_L14:;

    +464:                     c_servers[index].next = &c_servers[index] + 1

            (__pyx_v_c_servers[__pyx_v_index]).next = ((&(__pyx_v_c_servers[__pyx_v_index])) + 1);

    +465:                     index += 1

            __pyx_v_index = (__pyx_v_index + 1);

    +466:                     if index >= length:

            __pyx_t_7 = (__pyx_v_index >= __pyx_v_length);
            if (__pyx_t_7) {
    /* … */
            }

    +467:                         break

              goto __pyx_L12_break;

    +468:                 c_servers[length - 1].next = NULL

          (__pyx_v_c_servers[(__pyx_v_length - 1)]).next = NULL;

    +469:                 index = cares.ares_set_servers(self.channel, c_servers)

          __pyx_v_index = ares_set_servers(__pyx_v_self->channel, __pyx_v_c_servers);

    +470:                 if index:

          __pyx_t_7 = (__pyx_v_index != 0);
          if (unlikely(__pyx_t_7)) {
    /* … */
          }
        }

    +471:                     raise ValueError(_gevent_gai_strerror(index))

            __pyx_t_4 = NULL;
            __Pyx_INCREF(__pyx_builtin_ValueError);
            __pyx_t_2 = __pyx_builtin_ValueError;
            __pyx_t_12 = __Pyx_PyLong_From_int(__pyx_v_index); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 471, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_3 = __pyx_f_6gevent_8resolver_5cares__gevent_gai_strerror(__pyx_t_12); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 471, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            __pyx_t_5 = 1;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
              __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_1);
            }
            __Pyx_Raise(__pyx_t_1, 0, 0, 0);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __PYX_ERR(0, 471, __pyx_L9_error)

     472:             finally:

    +473:                 PyMem_Free(c_servers)

        /*finally:*/ {
          /*normal exit:*/{
            PyMem_Free(__pyx_v_c_servers);
            goto __pyx_L10;
          }
          __pyx_L9_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
            if ( unlikely(__Pyx_GetException(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18) < 0)) __Pyx_ErrFetch(&__pyx_t_16, &__pyx_t_17, &__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_16);
            __Pyx_XGOTREF(__pyx_t_17);
            __Pyx_XGOTREF(__pyx_t_18);
            __Pyx_XGOTREF(__pyx_t_19);
            __Pyx_XGOTREF(__pyx_t_20);
            __Pyx_XGOTREF(__pyx_t_21);
            __pyx_t_13 = __pyx_lineno; __pyx_t_14 = __pyx_clineno; __pyx_t_15 = __pyx_filename;
            {
              PyMem_Free(__pyx_v_c_servers);
            }
            __Pyx_XGIVEREF(__pyx_t_19);
            __Pyx_XGIVEREF(__pyx_t_20);
            __Pyx_XGIVEREF(__pyx_t_21);
            __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_17);
            __Pyx_XGIVEREF(__pyx_t_18);
            __Pyx_ErrRestore(__pyx_t_16, __pyx_t_17, __pyx_t_18);
            __pyx_t_16 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
            __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_14; __pyx_filename = __pyx_t_15;
            goto __pyx_L1_error;
          }
          __pyx_L10:;
        }
      }
      __pyx_L6:;

     474:

     475:     # this crashes c-ares

     476:     #def cancel(self):

     477:     #    cares.ares_cancel(self.channel)

     478:

    +479:     cdef _sock_state_callback(self, int socket, int read, int write):

    static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel__sock_state_callback(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_v_socket, int __pyx_v_read, int __pyx_v_write) {
      PyObject *__pyx_v_watcher = 0;
      int __pyx_v_events;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_AddTraceback("gevent.resolver.cares.channel._sock_state_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_watcher);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +480:         if not self.channel:

      __pyx_t_1 = (!(__pyx_v_self->channel != 0));
      if (__pyx_t_1) {
    /* … */
      }

    +481:             return

        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L0;

    +482:         cdef object watcher = self._watchers.get(socket)

      if (unlikely(__pyx_v_self->_watchers == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
        __PYX_ERR(0, 482, __pyx_L1_error)
      }
      __pyx_t_2 = __Pyx_PyLong_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 482, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_self->_watchers, __pyx_t_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 482, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_watcher = __pyx_t_3;
      __pyx_t_3 = 0;

    +483:         cdef int events = 0

      __pyx_v_events = 0;

    +484:         if read:

      __pyx_t_1 = (__pyx_v_read != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +485:             events |= EV_READ

        __pyx_v_events = (__pyx_v_events | EV_READ);

    +486:         if write:

      __pyx_t_1 = (__pyx_v_write != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +487:             events |= EV_WRITE

        __pyx_v_events = (__pyx_v_events | EV_WRITE);

    +488:         if watcher is None:

      __pyx_t_1 = (__pyx_v_watcher == Py_None);
      if (__pyx_t_1) {
    /* … */
        goto __pyx_L6;
      }

    +489:             if not events:

        __pyx_t_1 = (!(__pyx_v_events != 0));
        if (__pyx_t_1) {
    /* … */
        }

    +490:                 return

          __Pyx_XDECREF(__pyx_r);
          __pyx_r = Py_None; __Pyx_INCREF(Py_None);
          goto __pyx_L0;

    +491:             watcher = self.loop.io(socket, events)

        __pyx_t_2 = __pyx_v_self->loop;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 491, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_events); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 491, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = 0;
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_4, __pyx_t_5};
          __pyx_t_3 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_io, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 491, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_DECREF_SET(__pyx_v_watcher, __pyx_t_3);
        __pyx_t_3 = 0;

    +492:             self._watchers[socket] = watcher

        if (unlikely(__pyx_v_self->_watchers == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(0, 492, __pyx_L1_error)
        }
        __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 492, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        if (unlikely((PyDict_SetItem(__pyx_v_self->_watchers, __pyx_t_3, __pyx_v_watcher) < 0))) __PYX_ERR(0, 492, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +493:         elif events:

      __pyx_t_1 = (__pyx_v_events != 0);
      if (__pyx_t_1) {
    /* … */
        goto __pyx_L6;
      }

    +494:             if watcher.events == events:

        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_mstate_global->__pyx_n_u_events); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 494, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_events); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 494, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 494, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (__pyx_t_1) {
    /* … */
        }

    +495:                 return

          __Pyx_XDECREF(__pyx_r);
          __pyx_r = Py_None; __Pyx_INCREF(Py_None);
          goto __pyx_L0;

    +496:             watcher.stop()

        __pyx_t_5 = __pyx_v_watcher;
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_6 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_stop, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    +497:             watcher.events = events

        __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_events); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 497, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (__Pyx_PyObject_SetAttrStr(__pyx_v_watcher, __pyx_mstate_global->__pyx_n_u_events, __pyx_t_4) < 0) __PYX_ERR(0, 497, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

     498:         else:

    +499:             watcher.stop()

      /*else*/ {
        __pyx_t_5 = __pyx_v_watcher;
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_6 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_stop, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 499, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    +500:             watcher.close()

        __pyx_t_5 = __pyx_v_watcher;
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_6 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_close, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 500, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    +501:             self._watchers.pop(socket, None)

        if (unlikely(__pyx_v_self->_watchers == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
          __PYX_ERR(0, 501, __pyx_L1_error)
        }
        __pyx_t_4 = __Pyx_PyLong_From_int(__pyx_v_socket); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 501, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_7 = __Pyx_PyDict_Pop_ignore(__pyx_v_self->_watchers, __pyx_t_4, Py_None); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 501, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    +502:             if not self._watchers:

        __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_watchers); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 502, __pyx_L1_error)
        __pyx_t_8 = (!__pyx_t_1);
        if (__pyx_t_8) {
    /* … */
        }

    +503:                 self._timer.stop()

          __pyx_t_5 = __pyx_v_self->_timer;
          __Pyx_INCREF(__pyx_t_5);
          __pyx_t_6 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
            __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_stop, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 503, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    +504:             return

        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L0;
      }
      __pyx_L6:;

    +505:         watcher.start(self._process_fd, watcher, pass_events=True)

      __pyx_t_5 = __pyx_v_watcher;
      __Pyx_INCREF(__pyx_t_5);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_process_fd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[3 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_5, __pyx_t_3, __pyx_v_watcher};
        __pyx_t_2 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 505, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_pass_events, Py_True, __pyx_t_2, __pyx_callargs+3, 0) < 0) __PYX_ERR(0, 505, __pyx_L1_error)
        __pyx_t_4 = __Pyx_Object_VectorcallMethod_CallFromBuilder(__pyx_mstate_global->__pyx_n_u_start, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_2);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    +506:         self._timer.again(self._on_timer)

      __pyx_t_2 = __pyx_v_self->_timer;
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_on_timer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 506, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_3};
        __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_again, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 506, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

     507:

    +508:     def _on_timer(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_11_on_timer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_11_on_timer = {"_on_timer", (PyCFunction)__pyx_pw_6gevent_8resolver_5cares_7channel_11_on_timer, METH_NOARGS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_11_on_timer(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_on_timer (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_10_on_timer(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self));

      /* function exit code */
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_10_on_timer(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_11_on_timer, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_channel__on_timer, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 508, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel, __pyx_mstate_global->__pyx_n_u_on_timer, __pyx_t_5) < 0) __PYX_ERR(0, 508, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    +509:         cares.ares_process_fd(self.channel, cares.ARES_SOCKET_BAD, cares.ARES_SOCKET_BAD)

      ares_process_fd(__pyx_v_self->channel, ARES_SOCKET_BAD, ARES_SOCKET_BAD);

     510:

    +511:     def _process_fd(self, int events, object watcher):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_13_process_fd(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_13_process_fd = {"_process_fd", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_13_process_fd, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_13_process_fd(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      int __pyx_v_events;
      PyObject *__pyx_v_watcher = 0;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_process_fd (wrapper)", 0);
      #if !CYTHON_METH_FASTCALL
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      #endif
      __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      {
        PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_events,&__pyx_mstate_global->__pyx_n_u_watcher,0};
      PyObject* values[2] = {0,0};
        const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
        if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 511, __pyx_L3_error)
        if (__pyx_kwds_len > 0) {
          switch (__pyx_nargs) {
            case  2:
            values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 511, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  1:
            values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 511, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          const Py_ssize_t kwd_pos_args = __pyx_nargs;
          if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_process_fd", 0) < 0) __PYX_ERR(0, 511, __pyx_L3_error)
          for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
            if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_process_fd", 1, 2, 2, i); __PYX_ERR(0, 511, __pyx_L3_error) }
          }
        } else if (unlikely(__pyx_nargs != 2)) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
          if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 511, __pyx_L3_error)
          values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
          if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 511, __pyx_L3_error)
        }
        __pyx_v_events = __Pyx_PyLong_As_int(values[0]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 511, __pyx_L3_error)
        __pyx_v_watcher = values[1];
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("_process_fd", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 511, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __Pyx_AddTraceback("gevent.resolver.cares.channel._process_fd", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_12_process_fd(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_events, __pyx_v_watcher);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_12_process_fd(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, int __pyx_v_events, PyObject *__pyx_v_watcher) {
      int __pyx_v_read_fd;
      int __pyx_v_write_fd;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent.resolver.cares.channel._process_fd", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_13_process_fd, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_channel__process_fd, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 511, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel, __pyx_mstate_global->__pyx_n_u_process_fd, __pyx_t_5) < 0) __PYX_ERR(0, 511, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    +512:         if not self.channel:

      __pyx_t_1 = (!(__pyx_v_self->channel != 0));
      if (__pyx_t_1) {
    /* … */
      }

    +513:             return

        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L0;

    +514:         cdef int read_fd = watcher.fd

      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_watcher, __pyx_mstate_global->__pyx_n_u_fd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 514, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyLong_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_read_fd = __pyx_t_3;

    +515:         cdef int write_fd = read_fd

      __pyx_v_write_fd = __pyx_v_read_fd;

    +516:         if not (events & EV_READ):

      __pyx_t_1 = (!((__pyx_v_events & EV_READ) != 0));
      if (__pyx_t_1) {
    /* … */
      }

    +517:             read_fd = cares.ARES_SOCKET_BAD

        __pyx_v_read_fd = ARES_SOCKET_BAD;

    +518:         if not (events & EV_WRITE):

      __pyx_t_1 = (!((__pyx_v_events & EV_WRITE) != 0));
      if (__pyx_t_1) {
    /* … */
      }

    +519:             write_fd = cares.ARES_SOCKET_BAD

        __pyx_v_write_fd = ARES_SOCKET_BAD;

    +520:         cares.ares_process_fd(self.channel, read_fd, write_fd)

      ares_process_fd(__pyx_v_self->channel, __pyx_v_read_fd, __pyx_v_write_fd);

     521:

    +522:     @staticmethod

    static void __pyx_f_6gevent_8resolver_5cares_7channel__gethostbyname_or_byaddr_cb(void *__pyx_v_arg, int __pyx_v_status, CYTHON_UNUSED int __pyx_v_timeouts, struct hostent *__pyx_v_host) {
      struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_channel = 0;
      PyObject *__pyx_v_callback = 0;
      PyObject *__pyx_v_host_result = 0;
    /* … */
      /* function exit code */
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_12);
      __Pyx_XDECREF(__pyx_t_17);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_XDECREF(__pyx_t_19);
      __Pyx_XDECREF(__pyx_t_20);
      __Pyx_XDECREF(__pyx_t_21);
      __Pyx_XDECREF(__pyx_t_22);
      __Pyx_AddTraceback("gevent.resolver.cares.channel._gethostbyname_or_byaddr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_L0:;
      __Pyx_XDECREF((PyObject *)__pyx_v_channel);
      __Pyx_XDECREF(__pyx_v_callback);
      __Pyx_XDECREF(__pyx_v_host_result);
      __Pyx_RefNannyFinishContext();
    }

     523:     cdef void _gethostbyname_or_byaddr_cb(void *arg, int status, int timeouts, hostent* host):

     524:         cdef channel channel

     525:         cdef object callback

    +526:         channel, callback = <tuple>arg

      __pyx_t_1 = ((PyObject *)__pyx_v_arg);
      __Pyx_INCREF(__pyx_t_1);
      if (likely(__pyx_t_1 != Py_None)) {
        PyObject* sequence = __pyx_t_1;
        Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 526, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_3);
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 526, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 526, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 526, __pyx_L1_error)
      }
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel))))) __PYX_ERR(0, 526, __pyx_L1_error)
      __pyx_v_channel = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_v_callback = __pyx_t_3;
      __pyx_t_3 = 0;

    +527:         Py_DECREF(<tuple>arg)

      Py_DECREF(((PyObject *)__pyx_v_arg));

     528:         cdef object host_result

    +529:         try:

      {
        /*try:*/ {
    /* … */
        }
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L8_try_end;
        __pyx_L3_error:;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
        __Pyx_XDECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_XDECREF(__pyx_t_21); __pyx_t_21 = 0;
        __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    /* … */
        __pyx_L5_except_error:;
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        goto __pyx_L1_error;
        __pyx_L4_exception_handled:;
        __Pyx_XGIVEREF(__pyx_t_4);
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
        __pyx_L8_try_end:;
      }

    +530:             if status or not host:

          __pyx_t_8 = (__pyx_v_status != 0);
          if (!__pyx_t_8) {
          } else {
            __pyx_t_7 = __pyx_t_8;
            goto __pyx_L10_bool_binop_done;
          }
          __pyx_t_8 = (!(__pyx_v_host != 0));
          __pyx_t_7 = __pyx_t_8;
          __pyx_L10_bool_binop_done:;
          if (__pyx_t_7) {
    /* … */
            goto __pyx_L9;
          }

    +531:                 callback(Result(None, _gevent_herror_from_status(status)))

            __pyx_t_3 = NULL;
            __Pyx_INCREF(__pyx_v_callback);
            __pyx_t_2 = __pyx_v_callback;
            __pyx_t_10 = NULL;
            __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_Result);
            __pyx_t_11 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_Result);
            __pyx_t_12 = __pyx_f_6gevent_8resolver_5cares__gevent_herror_from_status(__pyx_v_status); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 531, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_13 = 1;
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_10, Py_None, __pyx_t_12};
              __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_13, (3-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
              if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 531, __pyx_L3_error)
              __Pyx_GOTREF((PyObject *)__pyx_t_9);
            }
            __pyx_t_13 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_2))) {
              __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
              assert(__pyx_t_3);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
              __pyx_t_13 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_t_9)};
              __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_DECREF((PyObject *)__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L3_error)
              __Pyx_GOTREF(__pyx_t_1);
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     532:             else:

    +533:                 try:

          /*else*/ {
            {
              /*try:*/ {
    /* … */
              }
    /* … */
              __pyx_L14_except_error:;
              __Pyx_XGIVEREF(__pyx_t_14);
              __Pyx_XGIVEREF(__pyx_t_15);
              __Pyx_XGIVEREF(__pyx_t_16);
              __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
              goto __pyx_L3_error;
              __pyx_L13_exception_handled:;
              __Pyx_XGIVEREF(__pyx_t_14);
              __Pyx_XGIVEREF(__pyx_t_15);
              __Pyx_XGIVEREF(__pyx_t_16);
              __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
              __pyx_L17_try_end:;
            }
          }
          __pyx_L9:;

    +534:                     host_result = ares_host_result(host.h_addrtype,

                __pyx_t_2 = NULL;
                __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_mstate_global->__pyx_n_u_ares_host_result); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 534, __pyx_L12_error)
                __Pyx_GOTREF(__pyx_t_9);
                __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_host->h_addrtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 534, __pyx_L12_error)
                __Pyx_GOTREF(__pyx_t_3);

    +535:                                                    (_as_str(host.h_name),

                __pyx_t_11 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_host->h_name); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 535, __pyx_L12_error)
                __Pyx_GOTREF(__pyx_t_11);
    /* … */
                __pyx_t_17 = PyTuple_New(3); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 535, __pyx_L12_error)
                __Pyx_GOTREF(__pyx_t_17);
                __Pyx_GIVEREF(__pyx_t_11);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_11) != (0)) __PYX_ERR(0, 535, __pyx_L12_error);
                __Pyx_GIVEREF(__pyx_t_12);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_12) != (0)) __PYX_ERR(0, 535, __pyx_L12_error);
                __Pyx_GIVEREF(__pyx_t_10);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_17, 2, __pyx_t_10) != (0)) __PYX_ERR(0, 535, __pyx_L12_error);
                __pyx_t_11 = 0;
                __pyx_t_12 = 0;
                __pyx_t_10 = 0;
                __pyx_t_13 = 1;
                #if CYTHON_UNPACK_METHODS
                if (unlikely(PyMethod_Check(__pyx_t_9))) {
                  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9);
                  assert(__pyx_t_2);
                  PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_9);
                  __Pyx_INCREF(__pyx_t_2);
                  __Pyx_INCREF(__pyx__function);
                  __Pyx_DECREF_SET(__pyx_t_9, __pyx__function);
                  __pyx_t_13 = 0;
                }
                #endif
                {
                  PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_3, __pyx_t_17};
                  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+__pyx_t_13, (3-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
                  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 534, __pyx_L12_error)
                  __Pyx_GOTREF(__pyx_t_1);
                }
                __pyx_v_host_result = __pyx_t_1;
                __pyx_t_1 = 0;

    +536:                                                     _parse_h_aliases(host),

                __pyx_t_12 = __pyx_f_6gevent_8resolver_5cares__parse_h_aliases(__pyx_v_host); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 536, __pyx_L12_error)
                __Pyx_GOTREF(__pyx_t_12);

    +537:                                                     _parse_h_addr_list(host)))

                __pyx_t_10 = __pyx_f_6gevent_8resolver_5cares__parse_h_addr_list(__pyx_v_host); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 537, __pyx_L12_error)
                __Pyx_GOTREF(__pyx_t_10);

    +538:                 except:

              /*except:*/ {
                __Pyx_AddTraceback("gevent.resolver.cares.channel._gethostbyname_or_byaddr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
                if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_17, &__pyx_t_3) < 0) __PYX_ERR(0, 538, __pyx_L14_except_error)
                __Pyx_XGOTREF(__pyx_t_1);
                __Pyx_XGOTREF(__pyx_t_17);
                __Pyx_XGOTREF(__pyx_t_3);

    +539:                     callback(Result(None, sys.exc_info()[1]))

                __pyx_t_10 = NULL;
                __Pyx_INCREF(__pyx_v_callback);
                __pyx_t_2 = __pyx_v_callback;
                __pyx_t_11 = NULL;
                __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_Result);
                __pyx_t_18 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_Result);
                __pyx_t_20 = NULL;
                __Pyx_GetModuleGlobalName(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 539, __pyx_L14_except_error)
                __Pyx_GOTREF(__pyx_t_21);
                __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_mstate_global->__pyx_n_u_exc_info); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 539, __pyx_L14_except_error)
                __Pyx_GOTREF(__pyx_t_22);
                __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
                __pyx_t_13 = 1;
                #if CYTHON_UNPACK_METHODS
                if (unlikely(PyMethod_Check(__pyx_t_22))) {
                  __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_22);
                  assert(__pyx_t_20);
                  PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_22);
                  __Pyx_INCREF(__pyx_t_20);
                  __Pyx_INCREF(__pyx__function);
                  __Pyx_DECREF_SET(__pyx_t_22, __pyx__function);
                  __pyx_t_13 = 0;
                }
                #endif
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_20, NULL};
                  __pyx_t_19 = __Pyx_PyObject_FastCall(__pyx_t_22, __pyx_callargs+__pyx_t_13, (1-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
                  __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
                  if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 539, __pyx_L14_except_error)
                  __Pyx_GOTREF(__pyx_t_19);
                }
                __pyx_t_22 = __Pyx_GetItemInt(__pyx_t_19, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 539, __pyx_L14_except_error)
                __Pyx_GOTREF(__pyx_t_22);
                __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
                __pyx_t_13 = 1;
                {
                  PyObject *__pyx_callargs[3] = {__pyx_t_11, Py_None, __pyx_t_22};
                  __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_18, __pyx_callargs+__pyx_t_13, (3-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
                  __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
                  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
                  if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 539, __pyx_L14_except_error)
                  __Pyx_GOTREF((PyObject *)__pyx_t_12);
                }
                __pyx_t_13 = 1;
                #if CYTHON_UNPACK_METHODS
                if (unlikely(PyMethod_Check(__pyx_t_2))) {
                  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_2);
                  assert(__pyx_t_10);
                  PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
                  __Pyx_INCREF(__pyx_t_10);
                  __Pyx_INCREF(__pyx__function);
                  __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
                  __pyx_t_13 = 0;
                }
                #endif
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_10, ((PyObject *)__pyx_t_12)};
                  __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
                  __Pyx_DECREF((PyObject *)__pyx_t_12); __pyx_t_12 = 0;
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 539, __pyx_L14_except_error)
                  __Pyx_GOTREF(__pyx_t_9);
                }
                __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
                __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                goto __pyx_L13_exception_handled;
              }

     540:                 else:

    +541:                     callback(Result(host_result))

              /*else:*/ {
                __pyx_t_9 = NULL;
                __Pyx_INCREF(__pyx_v_callback);
                __pyx_t_17 = __pyx_v_callback;
                __pyx_t_2 = NULL;
                __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_Result);
                __pyx_t_10 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_Result);
                __pyx_t_13 = 1;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_host_result};
                  __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 541, __pyx_L14_except_error)
                  __Pyx_GOTREF((PyObject *)__pyx_t_3);
                }
                __pyx_t_13 = 1;
                #if CYTHON_UNPACK_METHODS
                if (unlikely(PyMethod_Check(__pyx_t_17))) {
                  __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_17);
                  assert(__pyx_t_9);
                  PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_17);
                  __Pyx_INCREF(__pyx_t_9);
                  __Pyx_INCREF(__pyx__function);
                  __Pyx_DECREF_SET(__pyx_t_17, __pyx__function);
                  __pyx_t_13 = 0;
                }
                #endif
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_9, ((PyObject *)__pyx_t_3)};
                  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+__pyx_t_13, (2-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
                  __Pyx_DECREF((PyObject *)__pyx_t_3); __pyx_t_3 = 0;
                  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
                  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L14_except_error)
                  __Pyx_GOTREF(__pyx_t_1);
                }
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              }
              __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
              __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
              goto __pyx_L17_try_end;
              __pyx_L12_error:;
              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
              __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    +542:         except:

        /*except:*/ {
          __Pyx_AddTraceback("gevent.resolver.cares.channel._gethostbyname_or_byaddr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_17, &__pyx_t_1) < 0) __PYX_ERR(0, 542, __pyx_L5_except_error)
          __Pyx_XGOTREF(__pyx_t_3);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_1);

    +543:             channel.loop.handle_error(callback, *sys.exc_info())

          __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_channel->loop, __pyx_mstate_global->__pyx_n_u_handle_error); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 543, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_INCREF(__pyx_v_callback);
          __Pyx_GIVEREF(__pyx_v_callback);
          if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_callback) != (0)) __PYX_ERR(0, 543, __pyx_L5_except_error);
          __pyx_t_10 = NULL;
          __Pyx_GetModuleGlobalName(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 543, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_18);
          __pyx_t_22 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_mstate_global->__pyx_n_u_exc_info); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 543, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_22);
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          __pyx_t_13 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_22))) {
            __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_22);
            assert(__pyx_t_10);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_22);
            __Pyx_INCREF(__pyx_t_10);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_22, __pyx__function);
            __pyx_t_13 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_10, NULL};
            __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_22, __pyx_callargs+__pyx_t_13, (1-__pyx_t_13) | (__pyx_t_13*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
            if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 543, __pyx_L5_except_error)
            __Pyx_GOTREF(__pyx_t_12);
          }
          __pyx_t_22 = __Pyx_PySequence_Tuple(__pyx_t_12); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 543, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_22);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = PyNumber_Add(__pyx_t_2, __pyx_t_22); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 543, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
          __pyx_t_22 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 543, __pyx_L5_except_error)
          __Pyx_GOTREF(__pyx_t_22);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L4_exception_handled;
        }

     544:

     545:

    +546:     def gethostbyname(self, object callback, char* name, int family=AF_INET):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_15gethostbyname(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_15gethostbyname = {"gethostbyname", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_15gethostbyname, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_15gethostbyname(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_callback = 0;
      char *__pyx_v_name;
      int __pyx_v_family;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("gethostbyname (wrapper)", 0);
      #if !CYTHON_METH_FASTCALL
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      #endif
      __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      {
        PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_callback,&__pyx_mstate_global->__pyx_n_u_name_2,&__pyx_mstate_global->__pyx_n_u_family,0};
      PyObject* values[3] = {0,0,0};
        const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
        if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 546, __pyx_L3_error)
        if (__pyx_kwds_len > 0) {
          switch (__pyx_nargs) {
            case  3:
            values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 546, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  2:
            values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 546, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  1:
            values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 546, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          const Py_ssize_t kwd_pos_args = __pyx_nargs;
          if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "gethostbyname", 0) < 0) __PYX_ERR(0, 546, __pyx_L3_error)
          for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
            if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("gethostbyname", 0, 2, 3, i); __PYX_ERR(0, 546, __pyx_L3_error) }
          }
        } else {
          switch (__pyx_nargs) {
            case  3:
            values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 546, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  2:
            values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 546, __pyx_L3_error)
            values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 546, __pyx_L3_error)
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_callback = values[0];
        __pyx_v_name = __Pyx_PyObject_AsWritableString(values[1]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(0, 546, __pyx_L3_error)
        if (values[2]) {
          __pyx_v_family = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_family == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 546, __pyx_L3_error)
        } else {
          __pyx_v_family = __pyx_mstate_global->__pyx_k__5;
        }
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("gethostbyname", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 546, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyname", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_14gethostbyname(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_name, __pyx_v_family);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_14gethostbyname(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, char *__pyx_v_name, int __pyx_v_family) {
      PyObject *__pyx_v_arg = 0;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyname", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_mstate_global->__pyx_k__5 = AF_INET;
      __pyx_t_5 = __Pyx_PyLong_From_int(AF_INET); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 546, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyTuple_Pack(1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 546, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_15gethostbyname, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_channel_gethostbyname, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 546, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_t_6);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel, __pyx_mstate_global->__pyx_n_u_gethostbyname, __pyx_t_5) < 0) __PYX_ERR(0, 546, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    +547:         if not self.channel:

      __pyx_t_1 = (!(__pyx_v_self->channel != 0));
      if (unlikely(__pyx_t_1)) {
    /* … */
      }

    +548:             raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed')

        __pyx_t_3 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_gaierror); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 548, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyLong_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 548, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_5, __pyx_mstate_global->__pyx_kp_u_this_ares_channel_has_been_destr};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 548, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 548, __pyx_L1_error)

     549:         # note that for file lookups still AF_INET can be returned for AF_INET6 request

    +550:         cdef object arg = (self, callback)

      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 550, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF((PyObject *)__pyx_v_self);
      __Pyx_GIVEREF((PyObject *)__pyx_v_self);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)) != (0)) __PYX_ERR(0, 550, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_callback);
      __Pyx_GIVEREF(__pyx_v_callback);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_callback) != (0)) __PYX_ERR(0, 550, __pyx_L1_error);
      __pyx_v_arg = __pyx_t_2;
      __pyx_t_2 = 0;

    +551:         Py_INCREF(arg)

      Py_INCREF(__pyx_v_arg);

    +552:         cares.ares_gethostbyname(self.channel, name, family,

      ares_gethostbyname(__pyx_v_self->channel, __pyx_v_name, __pyx_v_family, ((void *)__pyx_f_6gevent_8resolver_5cares_7channel__gethostbyname_or_byaddr_cb), ((void *)__pyx_v_arg));

     553:                                  <void*>channel._gethostbyname_or_byaddr_cb, <void*>arg)

     554:

    +555:     def gethostbyaddr(self, object callback, char* addr):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_17gethostbyaddr(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_17gethostbyaddr = {"gethostbyaddr", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_17gethostbyaddr, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_17gethostbyaddr(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_callback = 0;
      char *__pyx_v_addr;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("gethostbyaddr (wrapper)", 0);
      #if !CYTHON_METH_FASTCALL
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      #endif
      __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      {
        PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_callback,&__pyx_mstate_global->__pyx_n_u_addr,0};
      PyObject* values[2] = {0,0};
        const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
        if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 555, __pyx_L3_error)
        if (__pyx_kwds_len > 0) {
          switch (__pyx_nargs) {
            case  2:
            values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 555, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  1:
            values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 555, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          const Py_ssize_t kwd_pos_args = __pyx_nargs;
          if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "gethostbyaddr", 0) < 0) __PYX_ERR(0, 555, __pyx_L3_error)
          for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
            if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("gethostbyaddr", 1, 2, 2, i); __PYX_ERR(0, 555, __pyx_L3_error) }
          }
        } else if (unlikely(__pyx_nargs != 2)) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
          if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 555, __pyx_L3_error)
          values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
          if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 555, __pyx_L3_error)
        }
        __pyx_v_callback = values[0];
        __pyx_v_addr = __Pyx_PyObject_AsWritableString(values[1]); if (unlikely((!__pyx_v_addr) && PyErr_Occurred())) __PYX_ERR(0, 555, __pyx_L3_error)
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("gethostbyaddr", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 555, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyaddr", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_16gethostbyaddr(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_addr);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_16gethostbyaddr(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, char *__pyx_v_addr) {
      char __pyx_v_addr_packed[16];
      int __pyx_v_family;
      int __pyx_v_length;
      PyObject *__pyx_v_arg = 0;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_7);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.gethostbyaddr", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_17gethostbyaddr, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_channel_gethostbyaddr, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel, __pyx_mstate_global->__pyx_n_u_gethostbyaddr, __pyx_t_5) < 0) __PYX_ERR(0, 555, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    +556:         if not self.channel:

      __pyx_t_1 = (!(__pyx_v_self->channel != 0));
      if (unlikely(__pyx_t_1)) {
    /* … */
      }

    +557:             raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed')

        __pyx_t_3 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_gaierror); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 557, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyLong_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 557, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_5, __pyx_mstate_global->__pyx_kp_u_this_ares_channel_has_been_destr};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 557, __pyx_L1_error)

     558:         # will guess the family

     559:         cdef char addr_packed[16]

     560:         cdef int family

     561:         cdef int length

    +562:         if cares.ares_inet_pton(AF_INET, addr, addr_packed) > 0:

      __pyx_t_1 = (ares_inet_pton(AF_INET, __pyx_v_addr, __pyx_v_addr_packed) > 0);
      if (__pyx_t_1) {
    /* … */
        goto __pyx_L4;
      }

    +563:             family = AF_INET

        __pyx_v_family = AF_INET;

    +564:             length = 4

        __pyx_v_length = 4;

    +565:         elif cares.ares_inet_pton(AF_INET6, addr, addr_packed) > 0:

      __pyx_t_1 = (ares_inet_pton(AF_INET6, __pyx_v_addr, __pyx_v_addr_packed) > 0);
      if (likely(__pyx_t_1)) {
    /* … */
        goto __pyx_L4;
      }

    +566:             family = AF_INET6

        __pyx_v_family = AF_INET6;

    +567:             length = 16

        __pyx_v_length = 16;

     568:         else:

    +569:             raise InvalidIP(repr(addr))

      /*else*/ {
        __pyx_t_4 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_InvalidIP); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 569, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_addr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 569, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_7 = PyObject_Repr(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 569, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_5))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
          assert(__pyx_t_4);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 569, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 569, __pyx_L1_error)
      }
      __pyx_L4:;

    +570:         cdef object arg = (self, callback)

      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF((PyObject *)__pyx_v_self);
      __Pyx_GIVEREF((PyObject *)__pyx_v_self);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)) != (0)) __PYX_ERR(0, 570, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_callback);
      __Pyx_GIVEREF(__pyx_v_callback);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_callback) != (0)) __PYX_ERR(0, 570, __pyx_L1_error);
      __pyx_v_arg = __pyx_t_2;
      __pyx_t_2 = 0;

    +571:         Py_INCREF(arg)

      Py_INCREF(__pyx_v_arg);

    +572:         cares.ares_gethostbyaddr(self.channel, addr_packed, length, family,

      ares_gethostbyaddr(__pyx_v_self->channel, __pyx_v_addr_packed, __pyx_v_length, __pyx_v_family, ((void *)__pyx_f_6gevent_8resolver_5cares_7channel__gethostbyname_or_byaddr_cb), ((void *)__pyx_v_arg));

     573:                                  <void*>channel._gethostbyname_or_byaddr_cb, <void*>arg)

     574:

    +575:     cpdef _getnameinfo(self, object callback, tuple sockaddr, int flags):

    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyObject *__pyx_f_6gevent_8resolver_5cares_7channel__getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags, int __pyx_skip_dispatch) {
      char *__pyx_v_hostp;
      int __pyx_v_port;
      int __pyx_v_flowinfo;
      int __pyx_v_scope_id;
      struct sockaddr_in6 __pyx_v_sa6;
      int __pyx_v_length;
      PyObject *__pyx_v_arg = 0;
      struct sockaddr *__pyx_v_x;
      PyObject *__pyx_r = NULL;
      /* Check if called by wrapper */
      if (unlikely(__pyx_skip_dispatch)) ;
      /* Check if overridden in Python */
      else if (
      #if !CYTHON_USE_TYPE_SLOTS
      unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel &&
      __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
      #else
      unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
      #endif
      ) {
        #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
        if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
          PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          #endif
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_getnameinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo)) {
            __Pyx_XDECREF(__pyx_r);
            __pyx_t_3 = NULL;
            __Pyx_INCREF(__pyx_t_1);
            __pyx_t_4 = __pyx_t_1;
            __pyx_t_5 = __Pyx_PyLong_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 575, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_6 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_4))) {
              __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
              assert(__pyx_t_3);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
              __pyx_t_6 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[4] = {__pyx_t_3, __pyx_v_callback, __pyx_v_sockaddr, __pyx_t_5};
              __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (4-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 575, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
            }
            __pyx_r = __pyx_t_2;
            __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            goto __pyx_L0;
          }
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
          __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
          if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
            __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
          }
          #endif
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
        }
        #endif
      }
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_AddTraceback("gevent.resolver.cares.channel._getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_19_getnameinfo = {"_getnameinfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_19_getnameinfo(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_callback = 0;
      PyObject *__pyx_v_sockaddr = 0;
      int __pyx_v_flags;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_getnameinfo (wrapper)", 0);
      #if !CYTHON_METH_FASTCALL
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      #endif
      __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      {
        PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_callback,&__pyx_mstate_global->__pyx_n_u_sockaddr,&__pyx_mstate_global->__pyx_n_u_flags,0};
      PyObject* values[3] = {0,0,0};
        const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
        if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 575, __pyx_L3_error)
        if (__pyx_kwds_len > 0) {
          switch (__pyx_nargs) {
            case  3:
            values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 575, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  2:
            values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 575, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  1:
            values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 575, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          const Py_ssize_t kwd_pos_args = __pyx_nargs;
          if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_getnameinfo", 0) < 0) __PYX_ERR(0, 575, __pyx_L3_error)
          for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
            if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_getnameinfo", 1, 3, 3, i); __PYX_ERR(0, 575, __pyx_L3_error) }
          }
        } else if (unlikely(__pyx_nargs != 3)) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
          if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 575, __pyx_L3_error)
          values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
          if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 575, __pyx_L3_error)
          values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
          if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 575, __pyx_L3_error)
        }
        __pyx_v_callback = values[0];
        __pyx_v_sockaddr = ((PyObject*)values[1]);
        __pyx_v_flags = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 575, __pyx_L3_error)
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("_getnameinfo", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 575, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __Pyx_AddTraceback("gevent.resolver.cares.channel._getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sockaddr), (&PyTuple_Type), 1, "sockaddr", 1))) __PYX_ERR(0, 575, __pyx_L1_error)
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_18_getnameinfo(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      goto __pyx_L0;
      __pyx_L1_error:;
      __pyx_r = NULL;
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      goto __pyx_L7_cleaned_up;
      __pyx_L0:;
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __pyx_L7_cleaned_up:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_18_getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags) {
      PyObject *__pyx_r = NULL;
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares_7channel__getnameinfo(__pyx_v_self, __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 575, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("gevent.resolver.cares.channel._getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_19_getnameinfo, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_channel__getnameinfo, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 575, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel, __pyx_mstate_global->__pyx_n_u_getnameinfo, __pyx_t_5) < 0) __PYX_ERR(0, 575, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    +576:         if not self.channel:

      __pyx_t_7 = (!(__pyx_v_self->channel != 0));
      if (unlikely(__pyx_t_7)) {
    /* … */
      }

    +577:             raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed')

        __pyx_t_2 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_gaierror); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 577, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyLong_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 577, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_2);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_t_5, __pyx_mstate_global->__pyx_kp_u_this_ares_channel_has_been_destr};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 577, __pyx_L1_error)

    +578:         cdef char* hostp = NULL

      __pyx_v_hostp = NULL;

    +579:         cdef int port = 0

      __pyx_v_port = 0;

    +580:         cdef int flowinfo = 0

      __pyx_v_flowinfo = 0;

    +581:         cdef int scope_id = 0

      __pyx_v_scope_id = 0;

     582:         cdef sockaddr_in6 sa6

    +583:         if not PyTuple_Check(sockaddr):

      __pyx_t_7 = (!PyTuple_Check(__pyx_v_sockaddr));
      if (unlikely(__pyx_t_7)) {
    /* … */
      }

    +584:             raise TypeError('expected a tuple, got %r' % (sockaddr, ))

        __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_builtin_TypeError);
        __pyx_t_5 = __pyx_builtin_TypeError;
        __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_sockaddr), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 584, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_expected_a_tuple_got, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 584, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_6 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 584, __pyx_L1_error)

    +585:         PyArg_ParseTuple(sockaddr, "si|ii", &hostp, &port, &flowinfo, &scope_id)

      __pyx_t_8 = PyArg_ParseTuple(__pyx_v_sockaddr, ((char *)"si|ii"), (&__pyx_v_hostp), (&__pyx_v_port), (&__pyx_v_flowinfo), (&__pyx_v_scope_id)); if (unlikely(__pyx_t_8 == ((int)0))) __PYX_ERR(0, 585, __pyx_L1_error)

     586:         # if port < 0 or port > 65535:

     587:         #     raise gaierror(-8, 'Invalid value for port: %r' % port)

    +588:         cdef int length = _make_sockaddr(hostp, port, flowinfo, scope_id, &sa6)

      __pyx_t_8 = __pyx_f_6gevent_8resolver_5cares__make_sockaddr(__pyx_v_hostp, __pyx_v_port, __pyx_v_flowinfo, __pyx_v_scope_id, (&__pyx_v_sa6)); if (unlikely(__pyx_t_8 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L1_error)
      __pyx_v_length = __pyx_t_8;

    +589:         if length <= 0:

      __pyx_t_7 = (__pyx_v_length <= 0);
      if (unlikely(__pyx_t_7)) {
    /* … */
      }

    +590:             raise InvalidIP(repr(hostp))

        __pyx_t_5 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_InvalidIP); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_hostp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_2 = PyObject_Repr(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
          assert(__pyx_t_5);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_2};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_Raise(__pyx_t_1, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __PYX_ERR(0, 590, __pyx_L1_error)

    +591:         cdef object arg = (self, callback)

      __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 591, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF((PyObject *)__pyx_v_self);
      __Pyx_GIVEREF((PyObject *)__pyx_v_self);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)) != (0)) __PYX_ERR(0, 591, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_callback);
      __Pyx_GIVEREF(__pyx_v_callback);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_callback) != (0)) __PYX_ERR(0, 591, __pyx_L1_error);
      __pyx_v_arg = __pyx_t_1;
      __pyx_t_1 = 0;

    +592:         Py_INCREF(arg)

      Py_INCREF(__pyx_v_arg);

    +593:         cdef sockaddr_t* x = <sockaddr_t*>&sa6

      __pyx_v_x = ((struct sockaddr *)(&__pyx_v_sa6));

    +594:         cares.ares_getnameinfo(self.channel, x, length, flags, <void*>gevent_ares_nameinfo_callback, <void*>arg)

      ares_getnameinfo(__pyx_v_self->channel, __pyx_v_x, __pyx_v_length, __pyx_v_flags, ((void *)__pyx_f_6gevent_8resolver_5cares_gevent_ares_nameinfo_callback), ((void *)__pyx_v_arg));

     595:

    +596:     @staticmethod

    static int __pyx_f_6gevent_8resolver_5cares_7channel__convert_cares_ni_flags(int __pyx_v_flags) {
      int __pyx_v_cares_flags;
      int __pyx_r;
    /* … */
      /* function exit code */
      __pyx_L0:;
      return __pyx_r;
    }

     597:     cdef int _convert_cares_ni_flags(int flags):

    +598:         cdef int cares_flags = cares.ARES_NI_LOOKUPHOST | cares.ARES_NI_LOOKUPSERVICE

      __pyx_v_cares_flags = (ARES_NI_LOOKUPHOST | ARES_NI_LOOKUPSERVICE);

    +599:         if flags & NI_NUMERICHOST:

      __pyx_t_1 = ((__pyx_v_flags & __pyx_v_6gevent_8resolver_5cares_NI_NUMERICHOST) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +600:             cares_flags |= cares.ARES_NI_NUMERICHOST

        __pyx_v_cares_flags = (__pyx_v_cares_flags | ARES_NI_NUMERICHOST);

    +601:         if flags & NI_NUMERICSERV:

      __pyx_t_1 = ((__pyx_v_flags & __pyx_v_6gevent_8resolver_5cares_NI_NUMERICSERV) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +602:             cares_flags |= cares.ARES_NI_NUMERICSERV

        __pyx_v_cares_flags = (__pyx_v_cares_flags | ARES_NI_NUMERICSERV);

    +603:         if flags & NI_NOFQDN:

      __pyx_t_1 = ((__pyx_v_flags & __pyx_v_6gevent_8resolver_5cares_NI_NOFQDN) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +604:             cares_flags |= cares.ARES_NI_NOFQDN

        __pyx_v_cares_flags = (__pyx_v_cares_flags | ARES_NI_NOFQDN);

    +605:         if flags & NI_NAMEREQD:

      __pyx_t_1 = ((__pyx_v_flags & __pyx_v_6gevent_8resolver_5cares_NI_NAMEREQD) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +606:             cares_flags |= cares.ARES_NI_NAMEREQD

        __pyx_v_cares_flags = (__pyx_v_cares_flags | ARES_NI_NAMEREQD);

    +607:         if flags & NI_DGRAM:

      __pyx_t_1 = ((__pyx_v_flags & __pyx_v_6gevent_8resolver_5cares_NI_DGRAM) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +608:             cares_flags |= cares.ARES_NI_DGRAM

        __pyx_v_cares_flags = (__pyx_v_cares_flags | ARES_NI_DGRAM);

    +609:         return cares_flags

      __pyx_r = __pyx_v_cares_flags;
      goto __pyx_L0;

     610:

    +611:     def getnameinfo(self, object callback, tuple sockaddr, int flags):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_21getnameinfo(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_21getnameinfo = {"getnameinfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_21getnameinfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_21getnameinfo(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_callback = 0;
      PyObject *__pyx_v_sockaddr = 0;
      int __pyx_v_flags;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("getnameinfo (wrapper)", 0);
      #if !CYTHON_METH_FASTCALL
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      #endif
      __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      {
        PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_callback,&__pyx_mstate_global->__pyx_n_u_sockaddr,&__pyx_mstate_global->__pyx_n_u_flags,0};
      PyObject* values[3] = {0,0,0};
        const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
        if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 611, __pyx_L3_error)
        if (__pyx_kwds_len > 0) {
          switch (__pyx_nargs) {
            case  3:
            values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 611, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  2:
            values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 611, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  1:
            values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 611, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          const Py_ssize_t kwd_pos_args = __pyx_nargs;
          if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getnameinfo", 0) < 0) __PYX_ERR(0, 611, __pyx_L3_error)
          for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
            if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getnameinfo", 1, 3, 3, i); __PYX_ERR(0, 611, __pyx_L3_error) }
          }
        } else if (unlikely(__pyx_nargs != 3)) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
          if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 611, __pyx_L3_error)
          values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
          if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 611, __pyx_L3_error)
          values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
          if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 611, __pyx_L3_error)
        }
        __pyx_v_callback = values[0];
        __pyx_v_sockaddr = ((PyObject*)values[1]);
        __pyx_v_flags = __Pyx_PyLong_As_int(values[2]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 611, __pyx_L3_error)
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("getnameinfo", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 611, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __Pyx_AddTraceback("gevent.resolver.cares.channel.getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_sockaddr), (&PyTuple_Type), 1, "sockaddr", 1))) __PYX_ERR(0, 611, __pyx_L1_error)
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_20getnameinfo(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      goto __pyx_L0;
      __pyx_L1_error:;
      __pyx_r = NULL;
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      goto __pyx_L7_cleaned_up;
      __pyx_L0:;
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __pyx_L7_cleaned_up:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_20getnameinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_sockaddr, int __pyx_v_flags) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.getnameinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_21getnameinfo, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_channel_getnameinfo, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel, __pyx_mstate_global->__pyx_n_u_getnameinfo_2, __pyx_t_5) < 0) __PYX_ERR(0, 611, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    +612:         flags = channel._convert_cares_ni_flags(flags)

      __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares_7channel__convert_cares_ni_flags(__pyx_v_flags); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 612, __pyx_L1_error)
      __pyx_v_flags = __pyx_t_1;

    +613:         return self._getnameinfo(callback, sockaddr, flags)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_8resolver_5cares_channel *)__pyx_v_self->__pyx_vtab)->_getnameinfo(__pyx_v_self, __pyx_v_callback, __pyx_v_sockaddr, __pyx_v_flags, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 613, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

     614:

    +615:     @staticmethod

    static int __pyx_f_6gevent_8resolver_5cares_7channel__convert_cares_ai_flags(int __pyx_v_flags) {
      int __pyx_v_cares_flags;
      int __pyx_r;
    /* … */
      /* function exit code */
      __pyx_L0:;
      return __pyx_r;
    }

     616:     cdef int _convert_cares_ai_flags(int flags):

     617:         # c-ares supports a limited set of flags.

     618:         # We always want NOSORT, because that implies that

     619:         # c-ares will not connect to resolved addresses.

    +620:         cdef int cares_flags = cares.ARES_AI_NOSORT

      __pyx_v_cares_flags = ARES_AI_NOSORT;

    +621:         if flags & AI_CANONNAME:

      __pyx_t_1 = ((__pyx_v_flags & __pyx_v_6gevent_8resolver_5cares_AI_CANONNAME) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +622:             cares_flags |= cares.ARES_AI_CANONNAME

        __pyx_v_cares_flags = (__pyx_v_cares_flags | ARES_AI_CANONNAME);

    +623:         if flags & AI_NUMERICSERV:

      __pyx_t_1 = ((__pyx_v_flags & __pyx_v_6gevent_8resolver_5cares_AI_NUMERICSERV) != 0);
      if (__pyx_t_1) {
    /* … */
      }

    +624:             cares_flags |= cares.ARES_AI_NUMERICSERV

        __pyx_v_cares_flags = (__pyx_v_cares_flags | ARES_AI_NUMERICSERV);

    +625:         return cares_flags

      __pyx_r = __pyx_v_cares_flags;
      goto __pyx_L0;

     626:

    +627:     @staticmethod

    static void __pyx_f_6gevent_8resolver_5cares_7channel__getaddrinfo_cb(void *__pyx_v_arg, int __pyx_v_status, CYTHON_UNUSED int __pyx_v_timeouts, struct ares_addrinfo *__pyx_v_result) {
      struct ares_addrinfo_node *__pyx_v_nodes;
      struct ares_addrinfo_cname *__pyx_v_cnames;
      struct sockaddr_in *__pyx_v_sadr4;
      struct sockaddr_in6 *__pyx_v_sadr6;
      PyObject *__pyx_v_canonname = 0;
      struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_channel = 0;
      PyObject *__pyx_v_callback = 0;
      char __pyx_v_tmpbuf[46];
      PyObject *__pyx_v_addrs = NULL;
      PyObject *__pyx_v_sockaddr = NULL;
    /* … */
      /* function exit code */
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_16);
      __Pyx_XDECREF(__pyx_t_17);
      __Pyx_AddTraceback("gevent.resolver.cares.channel._getaddrinfo_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_canonname);
      __Pyx_XDECREF((PyObject *)__pyx_v_channel);
      __Pyx_XDECREF(__pyx_v_callback);
      __Pyx_XDECREF(__pyx_v_addrs);
      __Pyx_XDECREF(__pyx_v_sockaddr);
      __Pyx_RefNannyFinishContext();
    }

     628:     cdef void _getaddrinfo_cb(void *arg,

     629:                               int status,

     630:                               int timeouts,

     631:                               cares.ares_addrinfo* result):

     632:         cdef cares.ares_addrinfo_node* nodes

     633:         cdef cares.ares_addrinfo_cname* cnames

     634:         cdef sockaddr_in* sadr4

     635:         cdef sockaddr_in6* sadr6

    +636:         cdef object canonname = ''

      __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u__6);
      __pyx_v_canonname = __pyx_mstate_global->__pyx_kp_u__6;

     637:

     638:         cdef channel channel

     639:         cdef object callback

     640:         # INET6_ADDRSTRLEN is 46, but we can't use that named constant

     641:         # here; cython doesn't like it.

     642:         cdef char tmpbuf[46]

     643:

    +644:         channel, callback = <tuple>arg

      __pyx_t_1 = ((PyObject *)__pyx_v_arg);
      __Pyx_INCREF(__pyx_t_1);
      if (likely(__pyx_t_1 != Py_None)) {
        PyObject* sequence = __pyx_t_1;
        Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 644, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_3);
        #else
        __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 644, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 644, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 644, __pyx_L1_error)
      }
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel))))) __PYX_ERR(0, 644, __pyx_L1_error)
      __pyx_v_channel = ((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_v_callback = __pyx_t_3;
      __pyx_t_3 = 0;

    +645:         Py_DECREF(<tuple>arg)

      Py_DECREF(((PyObject *)__pyx_v_arg));

     646:

     647:

     648:         # Result is a list of:

     649:         # (family, socktype, proto, canonname, sockaddr)

     650:         # Where sockaddr depends on family; for INET it is

     651:         # (address, port)

     652:         # and INET6 is

     653:         # (address, port, flow info, scope id)

     654:         # TODO: Check the canonnames.

    +655:         addrs = []

      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 655, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_addrs = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

    +656:         try:

      /*try:*/ {
        {
          /*try:*/ {
    /* … */
          }
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          goto __pyx_L11_try_end;
          __pyx_L6_error:;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    /* … */
          __pyx_L8_except_error:;
          __Pyx_XGIVEREF(__pyx_t_4);
          __Pyx_XGIVEREF(__pyx_t_5);
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
          goto __pyx_L4_error;
          __pyx_L10_try_return:;
          __Pyx_XGIVEREF(__pyx_t_4);
          __Pyx_XGIVEREF(__pyx_t_5);
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
          goto __pyx_L3_return;
          __pyx_L7_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_4);
          __Pyx_XGIVEREF(__pyx_t_5);
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
          __pyx_L11_try_end:;
        }
      }

    +657:             if status != cares.ARES_SUCCESS:

            __pyx_t_7 = (__pyx_v_status != ARES_SUCCESS);
            if (__pyx_t_7) {
    /* … */
            }

    +658:                 callback(Result(None, _gevent_gaierror_from_status(status)))

              __pyx_t_3 = NULL;
              __Pyx_INCREF(__pyx_v_callback);
              __pyx_t_2 = __pyx_v_callback;
              __pyx_t_9 = NULL;
              __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_Result);
              __pyx_t_10 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_Result);
              __pyx_t_11 = __pyx_f_6gevent_8resolver_5cares__gevent_gaierror_from_status(__pyx_v_status); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 658, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_12 = 1;
              {
                PyObject *__pyx_callargs[3] = {__pyx_t_9, Py_None, __pyx_t_11};
                __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
                __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 658, __pyx_L6_error)
                __Pyx_GOTREF((PyObject *)__pyx_t_8);
              }
              __pyx_t_12 = 1;
              #if CYTHON_UNPACK_METHODS
              if (unlikely(PyMethod_Check(__pyx_t_2))) {
                __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
                assert(__pyx_t_3);
                PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
                __Pyx_INCREF(__pyx_t_3);
                __Pyx_INCREF(__pyx__function);
                __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
                __pyx_t_12 = 0;
              }
              #endif
              {
                PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_t_8)};
                __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_DECREF((PyObject *)__pyx_t_8); __pyx_t_8 = 0;
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_1);
              }
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +659:                 return

              goto __pyx_L10_try_return;

    +660:             if result.cnames:

            __pyx_t_7 = (__pyx_v_result->cnames != 0);
            if (__pyx_t_7) {
    /* … */
            }

     661:                 # These tend to come in pairs:

     662:                 #

     663:                 # alias: www.gevent.org name: python-gevent.readthedocs.org

     664:                 # alias: python-gevent.readthedocs.org name: readthedocs.io

     665:                 #

     666:                 # The standard library returns the last name so we do too.

     667:

    +668:                 cnames = result.cnames

              __pyx_t_13 = __pyx_v_result->cnames;
              __pyx_v_cnames = __pyx_t_13;

    +669:                 while cnames:

              while (1) {
                __pyx_t_7 = (__pyx_v_cnames != 0);
                if (!__pyx_t_7) break;

    +670:                     canonname = _as_str(cnames.name)

                __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_cnames->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_DECREF_SET(__pyx_v_canonname, __pyx_t_1);
                __pyx_t_1 = 0;

    +671:                     cnames = cnames.next

                __pyx_t_13 = __pyx_v_cnames->next;
                __pyx_v_cnames = __pyx_t_13;
              }

     672:

    +673:             nodes = result.nodes

            __pyx_t_14 = __pyx_v_result->nodes;
            __pyx_v_nodes = __pyx_t_14;

    +674:             while nodes:

            while (1) {
              __pyx_t_7 = (__pyx_v_nodes != 0);
              if (!__pyx_t_7) break;

    +675:                 if nodes.ai_family == AF_INET:

              __pyx_t_7 = (__pyx_v_nodes->ai_family == AF_INET);
              if (__pyx_t_7) {
    /* … */
                goto __pyx_L18;
              }

    +676:                     sadr4 = <sockaddr_in*>nodes.ai_addr

                __pyx_v_sadr4 = ((struct sockaddr_in *)__pyx_v_nodes->ai_addr);

    +677:                     cares.ares_inet_ntop(nodes.ai_family, &sadr4.sin_addr, tmpbuf,

                (void)(ares_inet_ntop(__pyx_v_nodes->ai_family, (&__pyx_v_sadr4->sin_addr), __pyx_v_tmpbuf, INET6_ADDRSTRLEN));

     678:                                             INET6_ADDRSTRLEN)

     679:                     sockaddr = (

    +680:                         _as_str(tmpbuf),

                __pyx_t_1 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_tmpbuf); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 680, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_1);
    /* … */
                __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 680, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_8);
                __Pyx_GIVEREF(__pyx_t_1);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 680, __pyx_L6_error);
                __Pyx_GIVEREF(__pyx_t_2);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 680, __pyx_L6_error);
                __pyx_t_1 = 0;
                __pyx_t_2 = 0;
                __Pyx_XDECREF_SET(__pyx_v_sockaddr, ((PyObject*)__pyx_t_8));
                __pyx_t_8 = 0;

    +681:                         ntohs(sadr4.sin_port),

                __pyx_t_2 = __Pyx_PyLong_From_unsigned_int(ntohs(__pyx_v_sadr4->sin_port)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 681, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_2);

     682:                     )

    +683:                 elif nodes.ai_family == AF_INET6:

              __pyx_t_7 = (__pyx_v_nodes->ai_family == AF_INET6);
              if (__pyx_t_7) {
    /* … */
              }
              __pyx_L18:;

    +684:                     sadr6 = <sockaddr_in6*>nodes.ai_addr

                __pyx_v_sadr6 = ((struct sockaddr_in6 *)__pyx_v_nodes->ai_addr);

    +685:                     cares.ares_inet_ntop(nodes.ai_family, &sadr6.sin6_addr, tmpbuf,

                (void)(ares_inet_ntop(__pyx_v_nodes->ai_family, (&__pyx_v_sadr6->sin6_addr), __pyx_v_tmpbuf, INET6_ADDRSTRLEN));

     686:                                             INET6_ADDRSTRLEN)

     687:

     688:                     sockaddr = (

    +689:                         _as_str(tmpbuf),

                __pyx_t_8 = __pyx_f_6gevent_8resolver_5cares__as_str(__pyx_v_tmpbuf); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 689, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_8);
    /* … */
                __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 689, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_10);
                __Pyx_GIVEREF(__pyx_t_8);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8) != (0)) __PYX_ERR(0, 689, __pyx_L6_error);
                __Pyx_GIVEREF(__pyx_t_2);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 689, __pyx_L6_error);
                __Pyx_GIVEREF(__pyx_t_1);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_1) != (0)) __PYX_ERR(0, 689, __pyx_L6_error);
                __Pyx_GIVEREF(__pyx_t_3);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_3) != (0)) __PYX_ERR(0, 689, __pyx_L6_error);
                __pyx_t_8 = 0;
                __pyx_t_2 = 0;
                __pyx_t_1 = 0;
                __pyx_t_3 = 0;
                __Pyx_XDECREF_SET(__pyx_v_sockaddr, ((PyObject*)__pyx_t_10));
                __pyx_t_10 = 0;

    +690:                         ntohs(sadr6.sin6_port),

                __pyx_t_2 = __Pyx_PyLong_From_unsigned_int(ntohs(__pyx_v_sadr6->sin6_port)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_2);

    +691:                         sadr6.sin6_flowinfo,

                __pyx_t_1 = __Pyx_PyLong_From_unsigned_int(__pyx_v_sadr6->sin6_flowinfo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 691, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_1);

    +692:                         sadr6.sin6_scope_id,

                __pyx_t_3 = __Pyx_PyLong_From_unsigned_int(__pyx_v_sadr6->sin6_scope_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 692, __pyx_L6_error)
                __Pyx_GOTREF(__pyx_t_3);

     693:                     )

    +694:                 addrs.append((

              __pyx_t_15 = __Pyx_PyList_Append(__pyx_v_addrs, __pyx_t_2); if (unlikely(__pyx_t_15 == ((int)-1))) __PYX_ERR(0, 694, __pyx_L6_error)
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +695:                     nodes.ai_family,

              __pyx_t_10 = __Pyx_PyLong_From_int(__pyx_v_nodes->ai_family); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 695, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_10);
    /* … */
              __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 695, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_10);
              if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_10) != (0)) __PYX_ERR(0, 695, __pyx_L6_error);
              __Pyx_GIVEREF(__pyx_t_3);
              if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 695, __pyx_L6_error);
              __Pyx_GIVEREF(__pyx_t_1);
              if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1) != (0)) __PYX_ERR(0, 695, __pyx_L6_error);
              __Pyx_INCREF(__pyx_v_canonname);
              __Pyx_GIVEREF(__pyx_v_canonname);
              if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_canonname) != (0)) __PYX_ERR(0, 695, __pyx_L6_error);
              __Pyx_INCREF(__pyx_v_sockaddr);
              __Pyx_GIVEREF(__pyx_v_sockaddr);
              if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_sockaddr) != (0)) __PYX_ERR(0, 695, __pyx_L6_error);
              __pyx_t_10 = 0;
              __pyx_t_3 = 0;
              __pyx_t_1 = 0;

    +696:                     nodes.ai_socktype,

              __pyx_t_3 = __Pyx_PyLong_From_int(__pyx_v_nodes->ai_socktype); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 696, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_3);

    +697:                     nodes.ai_protocol,

              __pyx_t_1 = __Pyx_PyLong_From_int(__pyx_v_nodes->ai_protocol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 697, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_1);

     698:                     canonname,

    +699:                     sockaddr,

              if (unlikely(!__pyx_v_sockaddr)) { __Pyx_RaiseUnboundLocalError("sockaddr"); __PYX_ERR(0, 699, __pyx_L6_error) }

     700:                 ))

    +701:                 nodes = nodes.ai_next

              __pyx_t_14 = __pyx_v_nodes->ai_next;
              __pyx_v_nodes = __pyx_t_14;
            }

     702:

    +703:             callback(Result(addrs, None))

            __pyx_t_1 = NULL;
            __Pyx_INCREF(__pyx_v_callback);
            __pyx_t_3 = __pyx_v_callback;
            __pyx_t_8 = NULL;
            __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_Result);
            __pyx_t_11 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_Result);
            __pyx_t_12 = 1;
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_8, __pyx_v_addrs, Py_None};
              __pyx_t_10 = __Pyx_PyObject_FastCall(__pyx_t_11, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
              if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 703, __pyx_L6_error)
              __Pyx_GOTREF((PyObject *)__pyx_t_10);
            }
            __pyx_t_12 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
              assert(__pyx_t_1);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
              __pyx_t_12 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_1, ((PyObject *)__pyx_t_10)};
              __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_12, (2-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_DECREF((PyObject *)__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 703, __pyx_L6_error)
              __Pyx_GOTREF(__pyx_t_2);
            }
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +704:         except:

          /*except:*/ {
            __Pyx_AddTraceback("gevent.resolver.cares.channel._getaddrinfo_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_10) < 0) __PYX_ERR(0, 704, __pyx_L8_except_error)
            __Pyx_XGOTREF(__pyx_t_2);
            __Pyx_XGOTREF(__pyx_t_3);
            __Pyx_XGOTREF(__pyx_t_10);

    +705:             channel.loop.handle_error(callback, *sys.exc_info())

            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_channel->loop, __pyx_mstate_global->__pyx_n_u_handle_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L8_except_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 705, __pyx_L8_except_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_INCREF(__pyx_v_callback);
            __Pyx_GIVEREF(__pyx_v_callback);
            if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_callback) != (0)) __PYX_ERR(0, 705, __pyx_L8_except_error);
            __pyx_t_9 = NULL;
            __Pyx_GetModuleGlobalName(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 705, __pyx_L8_except_error)
            __Pyx_GOTREF(__pyx_t_16);
            __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_16, __pyx_mstate_global->__pyx_n_u_exc_info); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 705, __pyx_L8_except_error)
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
            __pyx_t_12 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_17))) {
              __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_17);
              assert(__pyx_t_9);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_17);
              __Pyx_INCREF(__pyx_t_9);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_17, __pyx__function);
              __pyx_t_12 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_9, NULL};
              __pyx_t_8 = __Pyx_PyObject_FastCall(__pyx_t_17, __pyx_callargs+__pyx_t_12, (1-__pyx_t_12) | (__pyx_t_12*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
              __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
              if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 705, __pyx_L8_except_error)
              __Pyx_GOTREF(__pyx_t_8);
            }
            __pyx_t_17 = __Pyx_PySequence_Tuple(__pyx_t_8); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 705, __pyx_L8_except_error)
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_8 = PyNumber_Add(__pyx_t_11, __pyx_t_17); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 705, __pyx_L8_except_error)
            __Pyx_GOTREF(__pyx_t_8);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 705, __pyx_L8_except_error)
            __Pyx_GOTREF(__pyx_t_17);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            goto __pyx_L7_exception_handled;
          }

     706:         finally:

    +707:             if result:

      /*finally:*/ {
        /*normal exit:*/{
          __pyx_t_7 = (__pyx_v_result != 0);
          if (__pyx_t_7) {
    /* … */
          }
          goto __pyx_L5;
        }
        __pyx_L4_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
          __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_21, &__pyx_t_22, &__pyx_t_23);
          if ( unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_6);
          __Pyx_XGOTREF(__pyx_t_5);
          __Pyx_XGOTREF(__pyx_t_4);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __Pyx_XGOTREF(__pyx_t_23);
          __pyx_t_18 = __pyx_lineno; __pyx_t_19 = __pyx_clineno; __pyx_t_20 = __pyx_filename;
          {
            __pyx_t_7 = (__pyx_v_result != 0);
            if (__pyx_t_7) {
    /* … */
            }
          }
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_XGIVEREF(__pyx_t_22);
          __Pyx_XGIVEREF(__pyx_t_23);
          __Pyx_ExceptionReset(__pyx_t_21, __pyx_t_22, __pyx_t_23);
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_XGIVEREF(__pyx_t_5);
          __Pyx_XGIVEREF(__pyx_t_4);
          __Pyx_ErrRestore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
          __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0; __pyx_t_23 = 0;
          __pyx_lineno = __pyx_t_18; __pyx_clineno = __pyx_t_19; __pyx_filename = __pyx_t_20;
          goto __pyx_L1_error;
        }
        __pyx_L3_return: {
          __pyx_t_7 = (__pyx_v_result != 0);
          if (__pyx_t_7) {
    /* … */
          }
          goto __pyx_L0;
        }
        __pyx_L5:;
      }

    +708:                 cares.ares_freeaddrinfo(result)

            ares_freeaddrinfo(__pyx_v_result);
    /* … */
              ares_freeaddrinfo(__pyx_v_result);
    /* … */
            ares_freeaddrinfo(__pyx_v_result);

     709:

    +710:     def getaddrinfo(self,

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_23getaddrinfo(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_8resolver_5cares_7channel_23getaddrinfo = {"getaddrinfo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_6gevent_8resolver_5cares_7channel_23getaddrinfo, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
    static PyObject *__pyx_pw_6gevent_8resolver_5cares_7channel_23getaddrinfo(PyObject *__pyx_v_self,
    #if CYTHON_METH_FASTCALL
    PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
    #else
    PyObject *__pyx_args, PyObject *__pyx_kwds
    #endif
    ) {
      PyObject *__pyx_v_callback = 0;
      char const *__pyx_v_name;
      PyObject *__pyx_v_service = 0;
      int __pyx_v_family;
      int __pyx_v_type;
      int __pyx_v_proto;
      int __pyx_v_flags;
      #if !CYTHON_METH_FASTCALL
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      #endif
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("getaddrinfo (wrapper)", 0);
      #if !CYTHON_METH_FASTCALL
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      #endif
      __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
      {
        PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_callback,&__pyx_mstate_global->__pyx_n_u_name_2,&__pyx_mstate_global->__pyx_n_u_service,&__pyx_mstate_global->__pyx_n_u_family,&__pyx_mstate_global->__pyx_n_u_type,&__pyx_mstate_global->__pyx_n_u_proto,&__pyx_mstate_global->__pyx_n_u_flags,0};
      PyObject* values[7] = {0,0,0,0,0,0,0};
        const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
        if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 710, __pyx_L3_error)
        if (__pyx_kwds_len > 0) {
          switch (__pyx_nargs) {
            case  7:
            values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 710, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  6:
            values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 710, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  5:
            values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 710, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  4:
            values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 710, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  3:
            values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 710, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  2:
            values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 710, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  1:
            values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 710, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          const Py_ssize_t kwd_pos_args = __pyx_nargs;
          if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "getaddrinfo", 0) < 0) __PYX_ERR(0, 710, __pyx_L3_error)
          for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
            if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("getaddrinfo", 0, 3, 7, i); __PYX_ERR(0, 710, __pyx_L3_error) }
          }
        } else {
          switch (__pyx_nargs) {
            case  7:
            values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 710, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  6:
            values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 710, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  5:
            values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 710, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  4:
            values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 710, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  3:
            values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 710, __pyx_L3_error)
            values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 710, __pyx_L3_error)
            values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 710, __pyx_L3_error)
            break;
            default: goto __pyx_L5_argtuple_error;
          }
        }
        __pyx_v_callback = values[0];
        __pyx_v_name = __Pyx_PyObject_AsString(values[1]); if (unlikely((!__pyx_v_name) && PyErr_Occurred())) __PYX_ERR(0, 712, __pyx_L3_error)
        __pyx_v_service = values[2];
        if (values[3]) {
          __pyx_v_family = __Pyx_PyLong_As_int(values[3]); if (unlikely((__pyx_v_family == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 714, __pyx_L3_error)
        } else {
          __pyx_v_family = ((int)0);
        }
        if (values[4]) {
          __pyx_v_type = __Pyx_PyLong_As_int(values[4]); if (unlikely((__pyx_v_type == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 715, __pyx_L3_error)
        } else {
          __pyx_v_type = ((int)0);
        }
        if (values[5]) {
          __pyx_v_proto = __Pyx_PyLong_As_int(values[5]); if (unlikely((__pyx_v_proto == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 716, __pyx_L3_error)
        } else {
          __pyx_v_proto = ((int)0);
        }
        if (values[6]) {
          __pyx_v_flags = __Pyx_PyLong_As_int(values[6]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 717, __pyx_L3_error)
        } else {
          __pyx_v_flags = ((int)0);
        }
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("getaddrinfo", 0, 3, 7, __pyx_nargs); __PYX_ERR(0, 710, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __Pyx_AddTraceback("gevent.resolver.cares.channel.getaddrinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return NULL;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_8resolver_5cares_7channel_22getaddrinfo(((struct __pyx_obj_6gevent_8resolver_5cares_channel *)__pyx_v_self), __pyx_v_callback, __pyx_v_name, __pyx_v_service, __pyx_v_family, __pyx_v_type, __pyx_v_proto, __pyx_v_flags);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_8resolver_5cares_7channel_22getaddrinfo(struct __pyx_obj_6gevent_8resolver_5cares_channel *__pyx_v_self, PyObject *__pyx_v_callback, char const *__pyx_v_name, PyObject *__pyx_v_service, int __pyx_v_family, int __pyx_v_type, int __pyx_v_proto, int __pyx_v_flags) {
      struct ares_addrinfo_hints __pyx_v_hints;
      PyObject *__pyx_v_arg = 0;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_AddTraceback("gevent.resolver.cares.channel.getaddrinfo", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_arg);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_8resolver_5cares_7channel_23getaddrinfo, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_channel_getaddrinfo, NULL, __pyx_mstate_global->__pyx_n_u_gevent_resolver_cares, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 710, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[3]);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_8resolver_5cares_channel, __pyx_mstate_global->__pyx_n_u_getaddrinfo, __pyx_t_5) < 0) __PYX_ERR(0, 710, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

     711:                     object callback,

     712:                     const char* name,

     713:                     object service, # AKA port

     714:                     int family=0,

     715:                     int type=0,

     716:                     int proto=0,

     717:                     int flags=0):

    +718:         if not self.channel:

      __pyx_t_1 = (!(__pyx_v_self->channel != 0));
      if (unlikely(__pyx_t_1)) {
    /* … */
      }

    +719:             raise gaierror(cares.ARES_EDESTRUCTION, 'this ares channel has been destroyed')

        __pyx_t_3 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_gaierror); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 719, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = __Pyx_PyLong_From_int(ARES_EDESTRUCTION); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 719, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_5, __pyx_mstate_global->__pyx_kp_u_this_ares_channel_has_been_destr};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 719, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_Raise(__pyx_t_2, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __PYX_ERR(0, 719, __pyx_L1_error)

     720:

     721:         cdef cares.ares_addrinfo_hints hints

    +722:         memset(&hints, 0, sizeof(cares.ares_addrinfo_hints))

      (void)(memset((&__pyx_v_hints), 0, (sizeof(struct ares_addrinfo_hints))));

     723:

    +724:         hints.ai_flags = channel._convert_cares_ai_flags(flags)

      __pyx_t_7 = __pyx_f_6gevent_8resolver_5cares_7channel__convert_cares_ai_flags(__pyx_v_flags); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 724, __pyx_L1_error)
      __pyx_v_hints.ai_flags = __pyx_t_7;

    +725:         hints.ai_family = family

      __pyx_v_hints.ai_family = __pyx_v_family;

    +726:         hints.ai_socktype = type

      __pyx_v_hints.ai_socktype = __pyx_v_type;

    +727:         hints.ai_protocol = proto

      __pyx_v_hints.ai_protocol = __pyx_v_proto;

    +728:         cdef object arg = (self, callback)

      __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF((PyObject *)__pyx_v_self);
      __Pyx_GIVEREF((PyObject *)__pyx_v_self);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)) != (0)) __PYX_ERR(0, 728, __pyx_L1_error);
      __Pyx_INCREF(__pyx_v_callback);
      __Pyx_GIVEREF(__pyx_v_callback);
      if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_callback) != (0)) __PYX_ERR(0, 728, __pyx_L1_error);
      __pyx_v_arg = __pyx_t_2;
      __pyx_t_2 = 0;

    +729:         Py_INCREF(arg)

      Py_INCREF(__pyx_v_arg);

     730:

    +731:         cares.ares_getaddrinfo(

      ares_getaddrinfo(__pyx_v_self->channel, __pyx_v_name, __pyx_t_8, (&__pyx_v_hints), ((void *)__pyx_f_6gevent_8resolver_5cares_7channel__getaddrinfo_cb), ((void *)__pyx_v_arg));

     732:             self.channel,

     733:             name,

    +734:             NULL if service is None else <char*>service,

      __pyx_t_1 = (__pyx_v_service == Py_None);
      if (__pyx_t_1) {
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_9 = __Pyx_PyObject_AsWritableString(__pyx_v_service); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 734, __pyx_L1_error)
        __pyx_t_8 = ((char *)__pyx_t_9);
      }

     735:             &hints,

     736:             <void*>channel._getaddrinfo_cb,

     737:             <void*>arg

     738:         )