+
    j                     <    R t ^ RIHt ^ RIHtHt  ! R R]4      tR# )zAsync uWSGI protocol parser for ASGI workers.

Reuses the parsing logic from gunicorn/uwsgi/message.py, only async I/O differs.
)UWSGIRequest)InvalidUWSGIHeaderUnsupportedModifierc                   j   a  ] tR t^t o RtRR lt]RR l4       tR tR t	R t
RR ltR tR	 tR
tV tR# )AsyncUWSGIRequesta6  Async version of UWSGIRequest.

Reuses all parsing logic from the sync version, only async I/O differs.
The following methods are reused from the parent class:
- _parse_vars() - pure parsing, no I/O
- _extract_request_info() - pure transformation
- _check_allowed_ip() - no I/O
- should_close() - simple logic
c                f   Wn         W n        W0n        W0n        W@n        R V n        R V n        R V n        R V n        RV n	        RV n
        . V n        . V n        R V n        VP                  '       d   RMRV n        RV n        / V n        ^ V n        ^ V n        R V n        ^ V n        RV n        ^ V n        R # )N httpshttpF)   r   )cfgunreader	peer_addrremote_addr
req_numbermethoduripathqueryfragmentversionheaderstrailersbodyis_sslscheme
must_close
uwsgi_vars	modifier1	modifier2proxy_protocol_infocontent_lengthchunked_body_remaining)selfr   r   r   r   s   &&&&&H/var/www/idalgo/venv/lib/python3.14/site-packages/gunicorn/asgi/uwsgi.py__init__AsyncUWSGIRequest.__init__   s      "$$ 	
	!$g#'        c                t   "   V ! WW44      pVP                  4        VP                  4       G Rj  xL
  V#  L5i)a  Parse a uWSGI request asynchronously.

Args:
    cfg: gunicorn config object
    unreader: AsyncUnreader instance
    peer_addr: client address tuple
    req_number: request number on this connection (for keepalive)

Returns:
    AsyncUWSGIRequest: Parsed request object

Raises:
    InvalidUWSGIHeader: If the uWSGI header is malformed
    UnsupportedModifier: If modifier1 is not 0
    ForbiddenUWSGIRequest: If source IP is not allowed
N)_check_allowed_ip_async_parse)clsr   r   r   r   reqs   &&&&& r%   parseAsyncUWSGIRequest.parse@   s;     $ #7   
 	!s   -868c                  "   V P                  ^4      G Rj  xL
 p\        V4      ^8  d   \        R4      hV^ ,          V n        \        P                  VR,          R4      pV^,          V n        V P                  ^ 8w  d   \        V P                  4      hV^ 8  dF   V P                  V4      G Rj  xL
 p\        V4      V8  d   \        R4      hV P                  V4       V P                  4        V P                  4        R#  L LT5i)z=Async version of parse() - reads data then uses sync parsing.Nzincomplete header:r      Nlittlezincomplete vars block)_async_read_exactlenr   r   int
from_bytesr   r   _parse_vars_extract_request_info_set_body_reader)r$   headerdatasize	vars_datas   &   r%   r+   AsyncUWSGIRequest._async_parseW   s      --a00v;?$%899>>&+x8>>Q%dnn55 a<"44X>>I9~(()@AAY'""$' 1 ?s#   DDBD1D2ADDc                   "   \        4       p\        V4      V8  dP   V P                  P                  V\        V4      ,
          4      G Rj  xL
 pV'       g   MVP	                  V4       K_  \        V4      #  L+5i)z'Read exactly size bytes asynchronously.N)	bytearrayr4   r   readextendbytes)r$   sizebufchunks   &&  r%   r3   #AsyncUWSGIRequest._async_read_exacto   sW     k#ho--,,TCH_==EJJuSz	 >s   A	A9A7A9 A9c                    ^ pRV P                   9   d(    \        \        V P                   R,          4      ^ 4      pWn        Wn        R#   \         d    ^ p Li ; i)z$Set up body state for async reading.CONTENT_LENGTHN)r   maxr5   
ValueErrorr!   r#   )r$   r!   s   & r%   r9   "AsyncUWSGIRequest._set_body_readery   sW    t.#!$S9I)J%KQ!O --  #!"#s   &A	 	AAc                   "   V P                   ^ 8:  d   R# \        WP                   4      pV P                  P                  V4      G Rj  xL
 pV'       d#   V ;P                   \	        V4      ,          un         V#  L05i)zRead body chunk asynchronously.

Args:
    size: Maximum bytes to read

Returns:
    bytes: Body data, empty bytes when body is exhausted
r(   N)r#   minr   r@   r4   )r$   rC   to_readdatas   &&  r%   	read_bodyAsyncUWSGIRequest.read_body   sa      1$d001]]''00  CI-  1s   AA<	A:
A<%A<c                ~   "   V P                   ^ 8  d&   V P                  R4      G Rj  xL
 pV'       d   K4  R# R#  L5i)zSDrain unread body data.

Should be called before reusing connection for keepalive.
    N)r#   rP   )r$   rO   s   & r%   
drain_bodyAsyncUWSGIRequest.drain_body   s6     
 ""Q&--D4 '-s   &=;	==c                d    VP                  4       pV P                   F  w  r#W!8X  g   K  Vu # 	  R# )zGet header by name (case-insensitive).

Args:
    name: Header name to look up

Returns:
    Header value if found, None otherwise
N)upperr   )r$   namehvs   &&  r%   
get_headerAsyncUWSGIRequest.get_header   s.     zz|LLDAy ! r(   )r#   r   r   r"   r!   r   r   r   r   r   r   r   r   r    r   r   r   r   r   r   r   r   r   N)r   )rS   )__name__
__module____qualname____firstlineno____doc__r&   classmethodr.   r+   r3   r9   rP   rT   r[   __static_attributes____classdictcell__)__classdict__s   @r%   r   r      sG     !F  , 0	." r(   r   N)ra   gunicorn.uwsgi.messager   gunicorn.uwsgi.errorsr   r   r    r(   r%   <module>ri      s"   

 0[ [r(   