%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
a
�_g�2 � @ s6 d Z ddlmZmZmZ ddlZddlZddlmZ ddlm Z ddlm
Z
ddlmZ ddlm
Z
dd lmZ dd
lmZ ddlmZ ddlmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZmZ ddl m!Z" ddl m#Z# dgZ$G dd� de#�Z%dS )z!
c-ares based hostname resolver.
� )�absolute_import�print_function�divisionN)�gaierror)�herror)�error)�
EAI_NONAME)� text_type)�
integer_types)�Waiter)�get_hub)� AF_UNSPEC)�AF_INET)�AF_INET6)�
SOCK_DGRAM)�SOCK_STREAM)�SOL_TCP)�SOL_UDP)�config)�AresSettingMixin� )�channel� InvalidIP)�_lookup_port)�AbstractResolver�Resolverc @ s� e Zd ZdZeZddd�Zdd� Zdd � Zd
d� Z dd
� Z
dd� Zdd� Zd dd�Z
dd� Zdd� Zdd� Zdd� Zdd� ZdS )!r a
Implementation of the resolver API using the `c-ares`_ library.
This implementation uses the c-ares library to handle name
resolution. c-ares is natively asynchronous at the socket level
and so integrates well into gevent's event loop.
In comparison to :class:`gevent.resolver_thread.Resolver` (which
delegates to the native system resolver), the implementation is
much more complex. In addition, there have been reports of it not
properly honoring certain system configurations (for example, the
order in which IPv4 and IPv6 results are returned may not match
the threaded resolver). However, because it does not use threads,
it may scale better for applications that make many lookups.
There are some known differences from the system resolver.
- ``gethostbyname_ex`` and ``gethostbyaddr`` may return
different for the ``aliaslist`` tuple member. (Sometimes the
same, sometimes in a different order, sometimes a different
alias altogether.)
- ``gethostbyname_ex`` may return the ``ipaddrlist`` in a
different order.
- ``getaddrinfo`` does not return ``SOCK_RAW`` results.
- ``getaddrinfo`` may return results in a different order.
- Handling of ``.local`` (mDNS) names may be different, even
if they are listed in the hosts file.
- c-ares will not resolve ``broadcasthost``, even if listed in
the hosts file prior to 2020-04-30.
- This implementation may raise ``gaierror(4)`` where the
system implementation would raise ``herror(1)`` or vice versa,
with different error numbers. However, after 2020-04-30, this should be
much reduced.
- The results for ``localhost`` may be different. In
particular, some system resolvers will return more results
from ``getaddrinfo`` than c-ares does, such as SOCK_DGRAM
results, and c-ares may report more ips on a multi-homed
host.
- The system implementation may return some names fully qualified, where
this implementation returns only the host name. This appears to be
the case only with entries found in ``/etc/hosts``.
- c-ares supports a limited set of flags for ``getnameinfo`` and
``getaddrinfo``; unknown flags are ignored. System-specific flags
such as ``AI_V4MAPPED_CFG`` are not supported.
- ``getaddrinfo`` may return canonical names even without the ``AI_CANONNAME``
being set.
- ``getaddrinfo`` does not appear to support IPv6 symbolic scope IDs.
.. caution::
This module is considered extremely experimental on PyPy, and
due to its implementation in cython, it may be slower. It may also lead to
interpreter crashes.
.. versionchanged:: 1.5.0
This version of gevent typically embeds c-ares 1.15.0 or newer. In
that version of c-ares, domains ending in ``.onion`` `are never
resolved <https://github.com/c-ares/c-ares/issues/196>`_ or even
sent to the DNS server.
.. versionchanged:: 20.5.0
``getaddrinfo`` is now implemented using the native c-ares function
from c-ares 1.16 or newer.
.. versionchanged:: 20.5.0
Now ``herror`` and ``gaierror`` are raised more consistently with
the standard library resolver, and have more consistent errno values.
Handling of localhost and broadcast names is now more consistent.
.. versionchanged:: 22.10.1
Now has a ``__del__`` method that warns if the object is destroyed
without being properly closed.
.. _c-ares: http://c-ares.haxx.se
NTc K s� t �| � |d u rt� }|| _|rZtj�� D ],}t|t�r,|� � }|d ur,|�
|j|� q,| j|j
fi |��| _t�� | _|| _|j
jdd�| _| j�| j� d S )NF)�ref)r �__init__r �hubr �settings�values�
isinstancer �get�
setdefaultZ
kwarg_name�cares_class�loop�cares�os�getpid�pid�params�fork�fork_watcher�start�_on_fork)�selfr Zuse_environ�kwargsZsetting�value� r2 �A/vddos/python/lib/python3.9/site-packages/gevent/resolver/ares.pyr � s
zResolver.__init__c C s dt | �| jf S )Nz/<gevent.resolver_ares.Resolver at 0x%x ares=%r>)�idr&