CasperSecurity

Current Path : /lib/python3/dist-packages/httplib2/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/httplib2/__pycache__/decode.cpython-310.pyc

o

0�PjX�@svddlmZddlZGdd�de�ZGdd�de�ZGdd�de�ZGd	d
�d
e�Zdefdd
�ZGdd�de�Z	dS)�)�ProtocolNc@�eZdZdZdS)�DecodeRatioErrorzBOutput-to-input amplification ratio exceeded the configured limit.N��__name__�
__module__�__qualname__�__doc__�r
r
�1/usr/lib/python3/dist-packages/httplib2/decode.pyr�rc@r)�DecodeLimitErrorz,Total output length exceeded the hard limit.Nrr
r
r
rr
	rr
c@sVeZdZedefdd��Zdedefdd�Zdefdd�Zdd
ede	defdd
�Z
dS)�DecoderProtocol�returncC�dS�Nr
��selfr
r
r�needs_inputszDecoderProtocol.needs_input�bcCrrr
�rrr
r
r�decode�zDecoderProtocol.decodecCrrr
rr
r
r�flushrzDecoderProtocol.flush��data�
chunk_sizecCsbt�}|dkrt|�}tdt|�|�D]}||||�}|�|�|��q|�|���t|�S)Nr)�	bytearray�len�range�extendrr�bytes)rrr�out�i�chunkr
r
r�
consume_bytesszDecoderProtocol.consume_bytesN)r)rrr�property�boolrr!rr�intr%r
r
r
rr
src@sheZdZdZdZdZdZdZdZefde	fdd	�Z
ed
efdd��Z
d
ed
efdd�Zd
efdd�ZdS)�ZlibDecodera#
    Thin wrapper around zlib.Decompressor conforming to the Decoder interface.

    Note: zlib pushes all available decompressed data immediately upon receiving
    input. It never holds back output requiring `decode(b"")` to extract it.
    Thus, `needs_input` naturally remains True.
    )�_decoderi����/�wbitscCst�|�|_dSr)�zlib�
decompressobjr*)rr.r
r
r�__init__3szZlibDecoder.__init__rcCs|jdur	td��|jjS�Nzused after flush())r*�RuntimeError�eofrr
r
rr6s

zZlibDecoder.needs_inputrcCs|jdur	td��|j�|�Sr2)r*r3�
decompressrr
r
rr<s
zZlibDecoder.decodecCs&|jdur	td��|j��}d|_|Sr2)r*r3r)r�resultr
r
rrAs


zZlibDecoder.flushN)rrrr	�	__slots__�
WBITS_DEFLATE�
WBITS_ZLIB�
WBITS_GZIP�WBITS_AUTO_GZIP_ZLIBr(r1r&r'rr!rrr
r
r
rr)#sr)rcCs
ttj�Sr)r)r8r
r
r
r�DeflateDecoderIs
r<c
@s�eZdZdZ				ddededed	ed
eddfd
d�Zddd�Ze	de
fdd��Zdedefdd�Z
defdd�Zdedefdd�ZdS)�LimitDecoder)	r*�_ratio�_chunk_size�_safe_limit�_hard_limit�_consumed_length�_output_length�
_input_buffer�_flushed�dr���
�decoder�ratior�
safe_limit�
hard_limitrNcCs�|dkrtd|�d���|dkrtd|�d���|dkr$td|�d���|dkr0td|�d���||_||_||_||_||_d|_d|_t�|_	d|_
dS)NrzLimitDecoder() ratio=z expected >= 0zLimitDecoder() chunk_size=zLimitDecoder() safe_limit=F)�
ValueErrorr*r>r?r@rArBrCrrDrE)rrIrJrrKrLr
r
rr1Zs"
zLimitDecoder.__init__c	Cs�|jdkr|j|jkrtd|j�d|j����|jdkr$|j|jkr$dS|jdkrU|j|j|jkrW|jdkr=|j|jntd�}td|d�d|j�d|j�d	|j����dSdS)
NrzOutput length z exceeds hard limit �infzAmplification ratio z.1fz (�/z) exceeds limit )rArCr
r@r>rB�floatr)r�actual_ratior
r
r�
_check_limitsus���zLimitDecoder._check_limitscCs|jjSr)r*rrr
r
rr�szLimitDecoder.needs_inputrcCs |jrtd��|�|�}t|�S)Nzdecode() called after flush())rEr3�_pumpr!)rr�outputr
r
rr�s
zLimitDecoder.decodecCsT|jrtd��d|_|�d�}|j��}|�|�|jt|�7_|��t	|�S)Nzflush() called more than onceT�)
rEr3rSr*rr rCrrRr!)rrTrr
r
rr�s


zLimitDecoder.flushcCs�|j�|�t�}	|jjs)|j�d�}|r)|�|�|jt|�7_|��q	|jrat	|jd|j
��}|jd|j
�=|j�|�}|jt|�7_|r`|�|�|jt|�7_|��q		|S)NTrU)rDr rr*rrrCrrRr!r?rB)rrrTrr$r
r
rrS�s,

zLimitDecoder._pump)rFrrGrH)rN)rrrr7rrPr(r1rRr&r'rr!rrrrSr
r
r
rr=Ms2������
�
r=)
�typingrr/�	Exceptionrr
rr)r<r=r
r
r
r�<module>s&
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY