HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/twisted/names/__pycache__/resolve.cpython-38.pyc
U


W[!
�@srdZddlmZmZddlmZddlmZmZddl	m
Z
mZmZGdd�d�Z
eej�Gdd	�d	ej��Zd
S)z�
Lookup a name using multiple resolvers.

Future Plans: This needs someway to specify which resolver answered
the query, or someway to specify (authority|ttl|cache behavior|more?)
�)�division�absolute_import)�implementer)�defer�
interfaces)�dns�common�errorc@seZdZdd�Zdd�ZdS)�FailureHandlercCs||_||_||_dS�N)�resolver�query�timeout)�selfrr
r�r�7/usr/lib/python3/dist-packages/twisted/names/resolve.py�__init__szFailureHandler.__init__cCs"|�tjtjt�|�|j|j�Sr)	Ztrapr�DomainErrorr�TimeoutError�NotImplementedErrorrr
r)rZfailurerrr�__call__szFailureHandler.__call__N)�__name__�
__module__�__qualname__rrrrrrr
sr
c@s*eZdZdZdd�Zdd�Zd	dd�ZdS)
�
ResolverChainz8
    Lookup an address using multiple L{IResolver}s
    cCstj�|�||_dS)zi
        @type resolvers: L{list}
        @param resolvers: A L{list} of L{IResolver} providers.
        N)r�ResolverBaser�	resolvers)rrrrrr'szResolverChain.__init__cCs`|jst�t���St�|||�}|jd�||�}|jdd�D]}|�t	|j||��}qB|S)aN
        Build a L{dns.Query} for the given parameters and dispatch it
        to each L{IResolver} in C{self.resolvers} until an answer or
        L{error.AuthoritativeDomainError} is returned.

        @type name: C{str}
        @param name: DNS name to resolve.

        @type type: C{int}
        @param type: DNS record type.

        @type cls: C{int}
        @param cls: DNS record class.

        @type timeout: Sequence of C{int}
        @param timeout: Number of seconds after which to reissue the query.
            When the last timeout expires, the query is considered failed.

        @rtype: L{Deferred}
        @return: A L{Deferred} which fires with a three-tuple of lists of
            L{twisted.names.dns.RRHeader} instances.  The first element of the
            tuple gives answers.  The second element of the tuple gives
            authorities.  The third element of the tuple gives additional
            information.  The L{Deferred} may instead fail with one of the
            exceptions defined in L{twisted.names.error} or with
            C{NotImplementedError}.
        r�N)
rr�failr	rrZQueryr
�
addErrbackr
)r�name�cls�typer�q�d�rrrr�_lookup0s�zResolverChain._lookupNcCsR|jst�t���S|jd�||�}|jdd�D]}|�t|j||��}q4|S)Nrr)rrrr	r�lookupAllRecordsrr
)rr rr$r%rrrr'Ws�zResolverChain.lookupAllRecords)N)rrr�__doc__rr&r'rrrrr"s	'rN)r(Z
__future__rrZzope.interfacerZtwisted.internetrrZ
twisted.namesrrr	r
Z	IResolverrrrrrr�<module>s