
    AҐi                     R    d dl Z d dlmZ d dlmZmZ  G d d      Z G d de      Zy)    N)Request)SocketUnreaderIterUnreaderc                   ,    e Zd ZdZd Zd Zd Zd ZeZy)ParserNc                     || _         t        |d      rt        |      | _        nt	        |      | _        d | _        || _        d| _        y )Nrecvr   )cfghasattrr   unreaderr   mesgsource_addr	req_count)selfr
   sourcer   s       M/var/www/descvideos/venv/lib/python3.12/site-packages/gunicorn/http/parser.py__init__zParser.__init__   sC    66"*62DM(0DM	&     c                     | S )N r   s    r   __iter__zParser.__iter__   s    r   c                     | j                   rR	 | j                   j                  j                  d      }|r)| j                   j                  j                  d      }|r(yyy# t        j                  $ r Y yw xY w)zDiscard any unread body of the current message.

        This should be called before returning a keepalive connection to
        the poller to ensure the socket doesn't appear readable due to
        leftover body bytes.
        i   N)r   bodyreadsslSSLWantReadError)r   datas     r   finish_bodyzParser.finish_body   sg     99yy~~**4099>>..t4D  
 '' s   AA   A65A6c                 r   | j                   r$| j                   j                         r
t               | j                          | xj                  dz  c_        | j                  | j                  | j                  | j                  | j                        | _         | j                   s
t               | j                   S )N   )	r   should_closeStopIterationr   r   
mesg_classr
   r   r   r   s    r   __next__zParser.__next__.   s    99//1/! 	 	!OODHHdmmT=M=Mt~~^	yy/!yyr   )	__name__
__module____qualname__r$   r   r   r   r%   nextr   r   r   r   r      s"    J
  Dr   r   c                       e Zd ZeZy)RequestParserN)r&   r'   r(   r   r$   r   r   r   r+   r+   @   s    Jr   r+   )r   gunicorn.http.messager   gunicorn.http.unreaderr   r   r   r+   r   r   r   <module>r.      s'   
  ) ?2 2jF r   