관리-도구
편집 파일: asyncresolver.cpython-38.pyc
U /?�f�E � @ s� d Z ddlZddlZddlmZmZmZmZmZ ddl Z ddlZ ddlZ ddl Z ddlZ ddlZ ddlZ ddlZ ddlZ ddlmZmZmZmZ e jjZe jjZG dd� de jj�Zdaed�dd �Z dd�d d�Z!e j"j#e j$j%ddd ddddf ee j&j'e(f ee j"j)e(f ee j$j*e(f e+ee( e+e,ee- ee+ ee j.j/ e jj0d�dd�Z1e(eee jj0d�dd�Z2ej3fee j&j'e(f e,ee jj4d�dd�Z5ee j&j'e(f e j&j'd�dd�Z6d(e-dd�dd�Z7e j$j%dddfee j&j'e(f e j$j*e+ee ee j.j/ e j&j'd�dd �Z8d!ej3dfee j&j'e(f e,e,ee ed"�d#d$�Z9e j"j#e j$j%ddd ddddd!ej3dfee j&j'e(f ee j&j'e(f ee j"j)e(f ee j$j*e(f e+ee( e+e,ee- ee+ ee j.j/ e,e,ee e jj0d%�d&d'�Z:dS ))�Asynchronous DNS stub resolver.� N)�Any�Dict�List�Optional�Union)�NXDOMAIN�NoAnswer� NoRootSOA�NotAbsolutec @ s� e Zd ZdZejjejjdddddddf e ej jef e ejj ef e ejjef eee eeee ee eejj ejjd�dd�Zeeeejjd �d d�Zejfe ej jef eeejjd�d d�Ze ej jef ej jd�dd�Zdedd�dd�ZdS )�Resolverr FNTr ��qname�rdtype�rdclass�tcp�source�raise_on_no_answer�source_port�lifetime�search�backend�returnc � s t j�| |||||| �}| s&t j�� } t�� }|�� \} }|dk rF|S | dk sRt�d}|s.|�� \}}}|r|| � |�I dH | � |||j�}z |j| ||||| d�I dH }W n: t k r� } z|�d|�\}}W Y �qVW 5 d}~X Y nX |�|d�\}}|dk rV|S qVq.dS )a� Query nameservers asynchronously to find the answer to the question. *backend*, a ``dns.asyncbackend.Backend``, or ``None``. If ``None``, the default, then dnspython will use the default backend. See :py:func:`dns.resolver.Resolver.resolve()` for the documentation of the other parameters, exceptions, and return type of this method. NF)�timeoutr r �max_sizer )�dns�resolverZ_Resolution�asyncbackendZget_default_backend�timeZnext_request�AssertionErrorZnext_nameserver�sleep�_compute_timeout�errorsZasync_query� ExceptionZquery_result)�selfr r r r r r r r r r � resolution�start�request�answer�done� nameserver�backoffr �response�ex�_� r/ �?/opt/hc_python/lib/python3.8/site-packages/dns/asyncresolver.py�resolve- sJ � �zResolver.resolve��ipaddr�args�kwargsr c � sF i }|� |� tjj|d<