
    h                     |    S SK r S SKrS SKJrJrJr  S/r\ R                  " S\ R                  5      r	 " S S5      r
g)    N)ListOptionalUnionReceiveBuffers   
?
c                       \ rS rSrSS jrS\\\4   SS 4S jrS\	4S jr
S\4S jrS\4S	 jrS
\S\4S jrS
\S\\   4S jrS\\   4S jrS\\\      4S jrS\	4S jrSrg)r   /   returnNc                 >    [        5       U l        SU l        SU l        g Nr   )	bytearray_data_next_line_search_multiple_lines_searchselfs    D/var/www/html/env/lib/python3.13/site-packages/h11/_receivebuffer.py__init__ReceiveBuffer.__init__0   s    [
!"&'#    	byteslikec                 0    U =R                   U-  sl         U $ N)r   )r   r   s     r   __iadd__ReceiveBuffer.__iadd__5   s    

i
r   c                 *    [        [        U 5      5      $ r   )boollenr   s    r   __bool__ReceiveBuffer.__bool__9   s    CIr   c                 ,    [        U R                  5      $ r   )r   r   r   s    r   __len__ReceiveBuffer.__len__<   s    4::r   c                 ,    [        U R                  5      $ r   )bytesr   r   s    r   	__bytes__ReceiveBuffer.__bytes__@   s    TZZ  r   countc                 ^    U R                   S U nU R                   S U2	 SU l        SU l        U$ r   )r   r   r   r   r'   outs      r   _extractReceiveBuffer._extractC   s7    jj% JJvv!"&'#
r   c                 R    U R                   SU nU(       d  gU R                  U5      $ )z2
Extract a fixed number of bytes from the buffer.
N)r   r+   r)   s      r   maybe_extract_at_most#ReceiveBuffer.maybe_extract_at_mostM   s)     jj% }}U##r   c                     [        SU R                  S-
  5      nU R                  R                  SU5      nUS:X  a  [	        U R                  5      U l        gUS-   nU R                  U5      $ )z;
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_line%ReceiveBuffer.maybe_extract_next_lineW   sf    
 !D$:$:Q$>?jjoog/AB"%(_D" Ao}}S!!r   c                 6   U R                   SS S:X  a  U R                  S5        / $ U R                   SS S:X  a  U R                  S5        / $ [        R                  U R                   U R                  5      nUc(  [        S[        U R                   5      S-
  5      U l        gUR                  S5      S   nU R                  U5      nUR                  S5      nU H  nUR                  S5      (       d  M  US	 M      US	   US   s=:X  a  S
:X  d   e   eUS	S2	 U$ )zL
Extract everything up to the first blank line, and return a list of lines.
Nr1      
r4   r2   r   r3      r   )
r   r+   blank_line_regexsearchr   r5   r   spansplitendswith)r   matchr9   r*   lineslines         r   maybe_extract_lines!ReceiveBuffer.maybe_extract_linesh   s   
 ::bq>U"MM!I::bq>W$MM!I !''

D4O4OP=*-aTZZ11D*ED' jjmBmmC 		% D}}U##H  RyE"I,,,,,,"#Jr   c                 H     U R                   S   S:  $ ! [         a     gf = f)Nr   !   F)r   
IndexErrorr   s    r   +is_next_line_obviously_invalid_request_line9ReceiveBuffer.is_next_line_obviously_invalid_request_line   s.    	 ::a=4'' 		s    
!!)r   r   r   )r	   N)__name__
__module____qualname____firstlineno__r   r   r$   r   r   r   r   intr!   r%   r+   r   r.   r:   r   rH   rM   __static_attributes__ r   r   r   r   /   s    (
%y(8"9 o $  !5 !c i $3 $8I3F $"))< "" Xd9o%>  VT r   )resystypingr   r   r   __all__compile	MULTILINEr@   r   rU   r   r   <module>r\      s=    	 
 ( (
N ::j",,7 j jr   