CasperSecurity

Current Path : /lib/python3/dist-packages/supervisor/medusa/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/supervisor/medusa/__pycache__/producers.cpython-310.pyc

o

VƧ\#�@s�dZ	ddlmZddlmZGdd�d�ZGdd�d�ZGdd	�d	�ZGd
d�d�ZGdd
�d
�Z	Gdd�d�Z
Gdd�d�ZGdd�d�ZGdd�d�Z
Gdd�d�ZzddlZWneyfdZYnwGdd�d�ZGdd�d�ZdS)z;$Id: producers.py,v 1.9 2004/04/21 13:56:28 akuchling Exp $�)�find_prefix_at_end)�as_bytesc@�"eZdZdZddd�Zdd�ZdS)	�simple_producerzproducer for a string�cC�||_||_dS�N)�data�buffer_size��selfr	r
�r
�=/usr/lib/python3/dist-packages/supervisor/medusa/producers.py�__init__�
zsimple_producer.__init__cCsFt|j�|jkr|jd|j�}|j|jd�|_|S|j}d|_|S�N�)�lenr	r
�r�resultr
r
r�moreszsimple_producer.moreN�r��__name__�
__module__�__qualname__�__doc__rrr
r
r
rrs
rc@r)	�scanning_producerz:like simple_producer, but more efficient for large stringsrcC�||_||_d|_dS�Nr)r	r
�posrr
r
rr#�
zscanning_producer.__init__cCsV|jt|j�kr)|j}tt|j�|j|j�}|j||�}|jt|�7_|SdSr)r rr	�minr
)r�lp�rprr
r
rr(s
�zscanning_producer.moreNrrr
r
r
rr!s
rc@� eZdZdZdd�Zdd�ZdS)�lines_producerzproducer for a list of linescC�
||_dSr)�lines�rr(r
r
rr8�
zlines_producer.__init__cCs6|jr|jdd�}|jdd�|_d�|�dSdS)N�2�
�)r(�join)r�chunkr
r
rr;s
zlines_producer.moreNrr
r
r
rr&5sr&c@r%)�buffer_list_producerzproducer for a list of stringscC�d|_||_dSr)�index�buffers)rr3r
r
rrHrzbuffer_list_producer.__init__cCs2|jt|j�kr
dS|j|j}|jd7_|S�Nr�)r2rr3�rr	r
r
rrLs
zbuffer_list_producer.moreNrr
r
r
rr0Csr0c@s$eZdZdZdZdd�Zdd�ZdS)�
file_producerz(producer wrapper for file[-like] objects�cCr1r)�done�file)rr:r
r
rrZrzfile_producer.__init__cCs8|jrdS|j�|j�}|s|j��|`d|_dS|Sr4)r9r:�read�out_buffer_size�closer6r
r
rr^s
zfile_producer.moreN)rrrrr<rrr
r
r
rr7Ts
r7c@sHeZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dS)�output_producerz;Acts like an output file; suitable for capturing sys.stdoutcCs
d|_dSr�r	�rr
r
rrtr*zoutput_producer.__init__cCs&|�d�}d�|�}|j|7_dS)N�
r,)�splitr.r	)rr	r(r
r
r�writews

zoutput_producer.writecCs|j|d|_dS�Nr,r?)r�liner
r
r�	writeline|szoutput_producer.writelinecCs|jd�|�d|_dSrD)r	r.r)r
r
r�
writelinesszoutput_producer.writelinescC�dSrr
r@r
r
r�flush��zoutput_producer.flushcGrHrr
)r�argsr
r
r�	softspace�rJzoutput_producer.softspacecCs,|jr|jdd�}|jdd�|_|SdS)Nir-r?rr
r
rr�s
zoutput_producer.moreN)rrrrrrCrFrGrIrLrr
r
r
rr>rsr>c@r%)�composite_producerz$combine a fifo of producers into onecCr'r)�	producers)rrNr
r
rr�r*zcomposite_producer.__init__cCs>t|j�r|jd}|��}|r|S|j�d�t|j�sdS)Nrr)rrNr�pop)r�p�dr
r
rr�s


�zcomposite_producer.moreNrr
r
r
rrM�srMc@r)	�globbing_producerz�
    'glob' the output from a producer into a particular buffer size.
    helps reduce the number of calls to send().  [this appears to
    gain about 30% performance on requests to a single channel]
    r8cCs||_d|_||_dSr)�producer�bufferr
)rrSr
r
r
rr�r!zglobbing_producer.__init__cCsNt|j�|jkr|j��}|r|j||_nnt|j�|jks|j}d|_|Sr)rrTr
rSr)rr	�rr
r
rr�s
�zglobbing_producer.moreN)r8rr
r
r
rrR�s
rRc@r%)�hooked_producerz�
    A producer that will call <function> when it empties,.
    with an argument of the number of bytes produced.  Useful
    for logging/instrumentation purposes.
    cCrr)rS�function�bytes)rrSrWr
r
rr�r!zhooked_producer.__init__cCsD|jr |j��}|sd|_|�|j�|S|jt|�7_|SdS)Nr-)rSrrWrXrrr
r
rr�s
�zhooked_producer.moreNrr
r
r
rrV�srVc@s"eZdZdZddd�Zdd�ZdS)�chunked_producera'A producer that implements the 'chunked' transfer coding for HTTP/1.1.
    Here is a sample usage:
            request['Transfer-Encoding'] = 'chunked'
            request.push (
                    producers.chunked_producer (your_producer)
                    )
            request.done()
    NcCrr)rS�footers)rrSrZr
r
rr�rzchunked_producer.__init__cCs^|jr-|j��}|rdt|�}t|�d|dSd|_|jr+d�dg|j�dSdSdS)Nz%xs
�0s

s0

r)rSrrrrZr.)rr	�sr
r
rr�s
zchunked_producer.morerrr
r
r
rrY�s
	rYNc@r)	�compressed_producerz:
    Compress another producer on-the-fly, using ZLIB
    �cCs||_t�|�|_dSr)rS�zlib�compressobj�
compressor)rrS�levelr
r
rrszcompressed_producer.__init__cCsD|jr d}|s|j��}|sd|_|j��S|j�|�}|r|SdSr)rSrrarI�compress)r�cdatar	r
r
rrs

�zcompressed_producer.moreN)r^rr
r
r
rr]�s
r]c@s"eZdZdZd	dd�Zdd�ZdS)
�escaping_producerz0A producer that escapes a sequence of characters�
.�
..cCs"||_||_||_d|_t|_dSr)rS�esc_from�esc_torTr)rrSrhrir
r
rr s

zescaping_producer.__init__cCsh|j}|j}|j|j��}|r2|�||�}|�||�}|r-||d�|_|d|�Sd|_|S|Sr)rhrirTrSr�replacer)rrhrirT�ir
r
rr'szescaping_producer.moreN)rfrgrr
r
r
rres
re)�RCS_ID�asynchatr�supervisor.compatrrrr&r0r7r>rMrRrVrYr_�ImportErrorr]rer
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