← back to Atmos Game

assets/gen/.venv/lib/python3.12/site-packages/h11/__pycache__/_receivebuffer.cpython-312.pyc

37 lines

�

c�bj���|�ddlZddlZddlmZmZmZdgZejdej�Z	Gd�d�Z
y)�N)�List�Optional�Union�
ReceiveBuffers

?
c��eZdZdd�Zdeeefddfd�Zdefd�Z	de
fd�Zdefd�Zd	e
defd
�Z
d	e
deefd�Zdeefd�Zdeeefd
�Zdefd�Zy)r�returnNc�>�t�|_d|_d|_y�Nr)�	bytearray�_data�_next_line_search�_multiple_lines_search��selfs �i/Users/macstudio3/Projects/atmos-game/assets/gen/.venv/lib/python3.12/site-packages/h11/_receivebuffer.py�__init__zReceiveBuffer.__init__0s���[��
�!"���&'��#��	byteslikec�0�|xj|z
c_|S�N)r)rrs  r�__iadd__zReceiveBuffer.__iadd__5s���
�
�i��
��rc�*�tt|��Sr)�bool�lenrs r�__bool__zReceiveBuffer.__bool__9s���C��I��rc�,�t|j�Sr)rrrs r�__len__zReceiveBuffer.__len__<s���4�:�:��rc�,�t|j�Sr)�bytesrrs r�	__bytes__zReceiveBuffer.__bytes__@s���T�Z�Z� � r�countc�^�|jd|}|jd|�=d|_d|_|Sr
)rr
r�rr!�outs   r�_extractzReceiveBuffer._extractCs7���j�j��%� ���J�J�v��v��!"���&'��#��
rc�H�|jd|}|sy|j|�S)zB
        Extract a fixed number of bytes from the buffer.
        N)rr%r#s   r�maybe_extract_at_mostz#ReceiveBuffer.maybe_extract_at_mostMs)���j�j��%� �����}�}�U�#�#rc���td|jdz
�}|jjd|�}|dk(rt	|j�|_y|dz}|j|�S)zK
        Extract the first line, if it is completed in the buffer.
        r��
�����N�)�maxr
r�findrr%)r�search_start_index�partial_idx�idxs    r�maybe_extract_next_linez%ReceiveBuffer.maybe_extract_next_lineWsf��
!��D�$:�$:�Q�$>�?���j�j�o�o�g�/A�B���"��%(����_�D�"���A�o���}�}�S�!�!rc��|jdddk(r|jd�gS|jdddk(r|jd�gStj|j|j�}|�(tdt
|j�dz
�|_y|jd�d}|j|�}|jd�}|D]}|jd�s�|d=�|d	|dcxk(rd
k(sJ�J�|d	d�=|S)z\
        Extract everything up to the first blank line, and return a list of lines.
        Nr)�
r,r*rr+�
�����r)
rr%�blank_line_regex�searchrr-r�span�split�endswith)r�matchr1r$�lines�lines      r�maybe_extract_linesz!ReceiveBuffer.maybe_extract_lineshs
��
�:�:�b�q�>�U�"��M�M�!���I��:�:�b�q�>�W�$��M�M�!���I�!�'�'��
�
�D�4O�4O�P���=�*-�a��T�Z�Z��1�1D�*E�D�'���j�j��m�B����m�m�C� ���	�	�%� ���D��}�}�U�#���H���R�y�E�"�I�,��,�,�,�,�,��"�#�J��rc�F�	|jddkS#t$rYywxYw)Nr�!F)r�
IndexErrorrs r�+is_next_line_obviously_invalid_request_linez9ReceiveBuffer.is_next_line_obviously_invalid_request_line�s.��	��:�:�a�=�4�'�'���	��	�s��	 � )rN)�__name__�
__module__�__qualname__rrrrrrr�intrr r%rr'r2rr?rC�rrrr/s���(�
�%��y�(8�"9��o���$�����!�5�!��c��i��$�3�$�8�I�3F�$�"��)�)<�"�" �X�d�9�o�%>� �V�T�r)�re�sys�typingrrr�__all__�compile�	MULTILINEr7rrHrr�<module>rOs?��	�
�(�(��
��N�2�:�:�j�"�,�,�7��j�jr