
    Wh                     b    d dl Z d dlZdgZ e j        de j                  Z G d d          ZdS )    NReceiveBuffers   
?
c                   J    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 ZdS )r   c                 H    t                      | _        d| _        d| _        d S Nr   )	bytearray_data_next_line_search_multiple_lines_searchselfs    X/var/www/html/movieo_spanner_bot/venv/lib/python3.11/site-packages/h11/_receivebuffer.py__init__zReceiveBuffer.__init__/   s#    [[
!"&'###    c                 &    | xj         |z  c_         | S N)r   )r   	byteslikes     r   __iadd__zReceiveBuffer.__iadd__4   s    

i

r   c                 :    t          t          |                     S r   )boollenr   s    r   __bool__zReceiveBuffer.__bool__8   s    CIIr   c                 *    t          | j                  S r   )r   r   r   s    r   __len__zReceiveBuffer.__len__;   s    4:r   c                 *    t          | j                  S r   )bytesr   r   s    r   	__bytes__zReceiveBuffer.__bytes__?   s    TZ   r   c                 T    | j         d |         }| j         d |= d| _        d| _        |S r   )r   r	   r
   r   countouts      r   _extractzReceiveBuffer._extractB   s5    j% Jvv!"&'#
r   c                 R    | j         d|         }|sdS |                     |          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_mostL   s3     j%  	4}}U###r   c                     t          d| j        dz
            }| j                            d|          }|dk    rt	          | j                  | _        dS |dz   }|                     |          S )zK
        Extract the first line, if it is completed in the buffer.
        r         
N   )maxr	   r   findr   r!   )r   search_start_indexpartial_idxidxs       r   maybe_extract_next_linez%ReceiveBuffer.maybe_extract_next_lineV   so    
 !D$:Q$>??joog/ABB"%(__D"4 Ao}}S!!!r   c                 \   | j         dd         dk    r|                     d           g S | j         dd         dk    r|                     d           g S t                              | j         | j                  }|,t          dt          | j                   dz
            | _        dS |                    d          d         }|                     |          }|                    d          }|D ]}|	                    d          r|d= |d	         |d         cxk    rd
k    sn J |d	d= |S )z\
        Extract everything up to the first blank line, and return a list of lines.
        Nr%      
r(   r&   r   r'      r   )
r   r!   blank_line_regexsearchr
   r)   r   spansplitendswith)r   matchr-   r    lineslines         r   maybe_extract_linesz!ReceiveBuffer.maybe_extract_linesg   sA   
 :bqb>U""MM!I:bqb>W$$MM!I !''
D4OPP=*-aTZ11D*E*ED'4 jjmmBmmC  		%   	 	D}}U## HRyE"I,,,,,,,,,,"##Jr   c                 H    	 | j         d         dk     S # t          $ r Y dS w xY w)Nr   !   F)r   
IndexErrorr   s    r   +is_next_line_obviously_invalid_request_linez9ReceiveBuffer.is_next_line_obviously_invalid_request_line   s<    	 :a=4'' 	 	 	55	s    
!!N)__name__
__module____qualname__r   r   r   r   r   r!   r#   r.   r;   r?    r   r   r   r   .   s        ( ( (
      ! ! !  $ $ $" " ""     V    r   )resys__all__compile	MULTILINEr3   r   rC   r   r   <module>rI      st    				 




N 2:j",77 j j j j j j j j j jr   