ok

Mini Shell

Direktori : /opt/alt/python38/lib64/python3.8/site-packages/aiohttp/__pycache__/
Upload File :
Current File : //opt/alt/python38/lib64/python3.8/site-packages/aiohttp/__pycache__/resolver.cpython-38.pyc

U

'�7`�@s�ddlZddlZddlmZmZmZmZddlmZddl	m
Z
dZzddlZWne
k
rhdZYnXdZGdd	�d	e�ZGd
d�de�Zer�eneZdS)�N)�Any�Dict�List�Optional�)�AbstractResolver)�get_running_loop)�ThreadedResolver�
AsyncResolver�DefaultResolverFc@s^eZdZdZd
eejdd�dd�Zdej	fe
eeee
e
efd�dd	�Zdd
�dd�ZdS)r	zsUse Executor for synchronous getaddrinfo() calls, which defaults to
    concurrent.futures.ThreadPoolExecutor.
    N)�loop�returncCst|�|_dS�N)r�_loop)�selfr�r�C/opt/alt/python38/lib64/python3.8/site-packages/aiohttp/resolver.py�__init__szThreadedResolver.__init__r)�hostname�port�familyr
c
�s�|jj||tj|tjd�IdH}g}|D]r\}}}}}|tjkrj|drjt�|tjtjB�\}	}
t	|
�}n|dd�\}	}|�
||	|||tjtjBd��q(|S)N)�typer�flags���r�hostrr�protor)
rZgetaddrinfo�socketZSOCK_STREAMZ
AI_ADDRCONFIG�AF_INET6ZgetnameinfoZNI_NUMERICHOSTZNI_NUMERICSERV�int�append�AI_NUMERICHOST�AI_NUMERICSERV)rrrrZinfos�hosts�_r�addressrZ_portrrr�resolves4�
�

��zThreadedResolver.resolve�r
c�sdSrr�rrrr�close@szThreadedResolver.close)N)�__name__�
__module__�__qualname__�__doc__r�asyncio�AbstractEventLooprr�AF_INET�strr rrrr'r*rrrrr	s��$r	c@s�eZdZdZdeejeedd�dd�Zde	j
feeee
eeefd�dd	�Zde	j
feeee
eeefd�d
d�Zdd�d
d�ZdS)r
z9Use the `aiodns` package to make asynchronous DNS lookupsN)r�args�kwargsr
cOsHtdkrtd��t|�|_tj|d|i|��|_t|jd�sD|j|_dS)Nz Resolver requires aiodns libraryr�
gethostbyname)	�aiodns�RuntimeErrorrrZDNSResolver�	_resolver�hasattr�_resolve_with_queryr')rrr3r4rrrrGs
zAsyncResolver.__init__r)rrrr
c	
�s�z|j�||�IdH}WnLtjjk
rd}z*t|j�dkrF|jdnd}t|�|�W5d}~XYnXg}|jD]$}|�	||||dt
jt
jBd��qp|s�td��|S)Nr�DNS lookup failedrr)
r8r5r6�error�DNSError�lenr3�OSErrorZ	addressesr!rr"r#)	rrrr�resp�exc�msgr$r&rrrr'Ws&

��zAsyncResolver.resolvec

�s�|tjkrd}nd}z|j�||�IdH}WnLtjjk
rx}z*t|j�dkrZ|jdnd}t	|�|�W5d}~XYnXg}|D] }	|�
||	j||dtjd��q�|s�t	d��|S)NZAAAA�Arr;rr)
rrr8Zqueryr6r<r=r>r3r?r!rr")
rrrrZqtyper@rArBr$Zrrrrrr:qs,
��z!AsyncResolver._resolve_with_queryr(c�s
|j��Sr)r8Zcancelr)rrrr*�szAsyncResolver.close)N)r+r,r-r.rr/r0rrrr1r2r rrr'r:r*rrrrr
Ds2������ r
)r/r�typingrrrr�abcrZhelpersr�__all__r6�ImportErrorZaiodns_defaultr	r
rrrrr�<module>s
0Q

Zerion Mini Shell 1.0