403Webshell
Server IP : 217.160.0.135  /  Your IP : 216.73.217.85
Web Server : Apache
System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64
User : sws1074145052 ( 1074145052)
PHP Version : 8.3.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/websockets/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/websockets/__pycache__/streams.cpython-311.pyc
�

�=Xc���8�ddlmZddlmZGd�d��ZdS)�)�annotations)�	Generatorc�R�eZdZdZdd�Zdd�Zdd
�Zdd�Zdd
�Zdd�Z	dd�Z
dd�ZdS)�StreamReaderz�
    Generator-based stream reader.

    This class doesn't support concurrent calls to :meth:`read_line`,
    :meth:`read_exact`, or :meth:`read_to_eof`. Make sure calls are
    serialized.

    �return�Nonec�:�t��|_d|_dS)NF)�	bytearray�buffer�eof��selfs �4/usr/lib/python3/dist-packages/websockets/streams.py�__init__zStreamReader.__init__s���k�k���������m�int�Generator[None, None, bytes]c#�fK�d}d}	|j�d|��dz}|dkrnOt|j��}||krtd|�d|�d����|jrtd|�d	����d
V��t||krtd|�d|�d����|jd
|�}|jd
|�=|S)a�
        Read a LF-terminated line from the stream.

        This is a generator-based coroutine.

        The return value includes the LF character.

        Args:
            m: maximum number bytes to read; this is a security limit.

        Raises:
            EOFError: if the stream ends without a LF.
            RuntimeError: if the stream ends in more than ``m`` bytes.

        rT�
��read � bytes, expected no more than � bytes�stream ends after z bytes, before end of lineN)r�find�len�RuntimeErrorr�EOFError)rr�n�p�rs     r�	read_linezStreamReader.read_lines����� 
��
��		��� � ���*�*�Q�.�A��1�u�u���D�K� � �A��1�u�u�"�#U�1�#U�#U�A�#U�#U�#U�V�V�V��x�
S��Q�A�Q�Q�Q�R�R�R��E�E�E�		�
�q�5�5��Q�q�Q�Q��Q�Q�Q�R�R�R��K����O���K����O��rr c#�K�|dksJ�t|j��|krM|jr*t|j��}td|�d|�d����dV�t|j��|k�M|jd|�}|jd|�=|S)z�
        Read a given number of bytes from the stream.

        This is a generator-based coroutine.

        Args:
            n: how many bytes to read.

        Raises:
            EOFError: if the stream ends in less than ``n`` bytes.

        rrz bytes, expected rN)rrrr)rr r!r"s    r�
read_exactzStreamReader.read_exact6s������A�v�v�v�v��$�+����"�"��x�
S����$�$���Q�A�Q�Q��Q�Q�Q�R�R�R��E�E�E�	�$�+����"�"�

�K����O���K����O��rc#�K�|js;t|j��}||krtd|�d|�d����dV�|j�;|jdd�}|jdd�=|S)a
        Read all bytes from the stream.

        This is a generator-based coroutine.

        Args:
            m: maximum number bytes to read; this is a security limit.

        Raises:
            RuntimeError: if the stream ends in more than ``m`` bytes.

        rrrN)rrrr)rrr!r"s    r�read_to_eofzStreamReader.read_to_eofMs������(�	��D�K� � �A��1�u�u�"�#U�1�#U�#U�A�#U�#U�#U�V�V�V��E�E�E�	�(�	�

�K����N���K����N��r�Generator[None, None, bool]c#�6K�	|jrdS|jrdSdV��)zy
        Tell whether the stream has ended and all data was read.

        This is a generator-based coroutine.

        TFN)rrr
s r�at_eofzStreamReader.at_eofcs9����	��{�
��u��x�
��t�
�E�E�E�	r�data�bytesc�R�|jrtd���|xj|z
c_dS)z�
        Write data to the stream.

        :meth:`feed_data` cannot be called after :meth:`feed_eof`.

        Args:
            data: data to write.

        Raises:
            EOFError: if the stream has ended.

        �stream endedN)rrr)rr+s  r�	feed_datazStreamReader.feed_datass0���8�	+��>�*�*�*����t�����rc�@�|jrtd���d|_dS)z�
        End the stream.

        :meth:`feed_eof` cannot be called more than once.

        Raises:
            EOFError: if the stream has ended.

        r.TN)rrr
s r�feed_eofzStreamReader.feed_eof�s'���8�	+��>�*�*�*�����rc��|jdd�=dS)zG
        Discard all buffered data, but don't end the stream.

        N)rr
s r�discardzStreamReader.discard�s��

�K����N�N�NrN)rr)rrrr)r rrr)rr()r+r,rr)�__name__�
__module__�__qualname__�__doc__rr#r%r'r*r/r1r3�rrrrs������������� � � � �D����.����,���� ����"���������rrN)�
__future__r�typingrrr8rr�<module>r;se��"�"�"�"�"�"�������Q�Q�Q�Q�Q�Q�Q�Q�Q�Qr

Youez - 2016 - github.com/yon3zu
LinuXploit