AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/twisted/names/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /lib/python3/dist-packages/twisted/names/__pycache__/cache.cpython-310.pyc
o

�b��@sFdZddlmZddlmZmZddlmZmZGdd�dej	�Z
dS)z 
An in-memory caching resolver.
�)�defer)�common�dns)�failure�logc@sReZdZdZdZddd�Zdd�Zdd	�Zd
d�Zddd
�Z	ddd�Z
dd�ZdS)�
CacheResolverz�
    A resolver that serves records from a local, memory cache.

    @ivar _reactor: A provider of L{interfaces.IReactorTime}.
    NrcCshtj�|�i|_||_i|_|durddlm}||_|r0|�	�D]\}\}}|�
|||�q"dSdS)Nr)�reactor)r�ResolverBase�__init__�cache�verbose�cancel�twisted.internetr�_reactor�items�cacheResult)�selfrrr�query�seconds�payload�r�5/usr/lib/python3/dist-packages/twisted/names/cache.pyr
s�zCacheResolver.__init__c
Csb||_|j��}|j��D]!\}\}\}}}||}|||D]
}	|	j|kr-|j|=nq q
dS�N)�__dict__rrrr�ttl)
r�state�now�k�when�ans�add�ns�diff�recrrr�__setstate__&s

���zCacheResolver.__setstate__cCs(|j��D]}|��q|j��|jSr)r
�values�clearr)r�crrr�__getstate__1s

zCacheResolver.__getstate__c
s|j��}t�|||�}z|j|\}\}}	}
Wn"ty:|jdkr-t�dt	|��t
�t�
t�|���YSw|jrGt�dt	|��||�z�fdd�|D��fdd�|	D��fdd�|
D�f}Wnty{t
�t�
t�|���YSwt
�|�S)N�zCache miss for zCache hit for c	�.g|]}t�|jj|j|j|j�|j��qSr�r�RRHeader�name�type�clsrr��.0�r�r"rr�
<listcomp>G����z)CacheResolver._lookup.<locals>.<listcomp>c	r*rr+r0r3rrr4Mr5c	r*rr+r0r3rrr4Sr5)rrr�Queryr�KeyErrorrr�msg�reprr�failr�Failure�DomainError�
ValueError�succeed)rr-r/r.�timeoutr�qrr�authr �resultrr3r�_lookup7s6

�
�
�
���
zCacheResolver._lookupcCst�t�t�|���Sr)rr:rr;rr<)rr-r?rrr�lookupAllRecords_szCacheResolver.lookupAllRecordscCs�|jdkrt�d|�|p|j��|f|j|<||jvr$|j|��t|d�t|d�t|d�}|rI|dj}|D]}t	||j�}q?nd}|j�
||j|�|j|<dS)a�
        Cache a DNS entry.

        @param query: a L{dns.Query} instance.

        @param payload: a 3-tuple of lists of L{dns.RRHeader} records, the
            matching result of the query (answers, authority and additional).

        @param cacheTime: The time (seconds since epoch) at which the entry is
            considered to have been added to the cache. If L{None} is given,
            the current time is used.
        r)zAdding %r to cacher�N)rrr8rrrr
�listr�min�	callLater�
clearEntry)rrr�	cacheTime�s�mr2rrrrbs


$
�zCacheResolver.cacheResultcCs|j|=|j|=dSr)rr
)rrrrrrI�szCacheResolver.clearEntry)NrNr)�__name__�
__module__�__qualname__�__doc__rr
r$r(rCrDrrIrrrrrs

(
rN)rPrr�
twisted.namesrr�twisted.pythonrrr	rrrrr�<module>s


Anon7 - 2022
AnonSec Team