§
    §Mºf  ã                   ó:   — d dl mZ ddlmZ  G d„ de¦  «        ZdS )é    )ÚAsyncConsumeré   )ÚStopConsumerc                   óP   — e Zd ZdZd„ Zdddœd„Zddœd	„Zd
„ Zd„ Zd„ Z	d„ Z
d„ ZdS )ÚAsyncHttpConsumerzf
    Async HTTP consumer. Provides basic primitives for building asynchronous
    HTTP endpoints.
    c                 ó   — g | _         d S )N)Úbody)ÚselfÚargsÚkwargss      úT/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/channels/generic/http.pyÚ__init__zAsyncHttpConsumer.__init__   s   € ØˆŒ	ˆ	ˆ	ó    éÈ   N)ÚstatusÚheadersc             ƒ   ó¾   K  — |€g }n6t          |t          ¦  «        r!t          |                     ¦   «         ¦  «        }|                      d||dœ¦  «        ƒ d{V —† dS )a?  
        Sets the HTTP response status and headers. Headers may be provided as
        a list of tuples or as a dictionary.

        Note that the ASGI spec requires that the protocol server only starts
        sending the response to the client after ``self.send_body`` has been
        called the first time.
        Nzhttp.response.start)Útyper   r   )Ú
isinstanceÚdictÚlistÚitemsÚsend)r
   r   r   s      r   Úsend_headerszAsyncHttpConsumer.send_headers   s†   è è € ð ˆ?ØˆGˆGÝ˜¥Ñ&Ô&ð 	,Ý˜7Ÿ=š=™?œ?Ñ+Ô+ˆGà�iŠiØ*°fÈÐQÐQñ
ô 
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
r   F)Ú	more_bodyc             ƒ   ó†   K  — t          |t          ¦  «        s
J d¦   «         ‚|                      d||dœ¦  «        ƒ d{V —† dS )a  
        Sends a response body to the client. The method expects a bytestring.

        Set ``more_body=True`` if you want to send more body content later.
        The default behavior closes the response, and further messages on
        the channel will be ignored.
        zBody is not byteszhttp.response.body)r   r	   r   N)r   Úbytesr   )r
   r	   r   s      r   Ú	send_bodyzAsyncHttpConsumer.send_body!   sr   è è € õ ˜$¥Ñ&Ô&Ð;Ð;Ð(;Ñ;Ô;Ð;Ø�iŠiØ)°4ÀiÐPÐPñ
ô 
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
ð 	
r   c              ‹   ój   K  —  | j         dd|i|¤Žƒ d{V —† |                      |¦  «        ƒ d{V —† dS )zà
        Sends a response to the client. This is a thin wrapper over
        ``self.send_headers`` and ``self.send_body``, and everything said
        above applies here as well. This method may only be called once.
        r   N© )r   r   )r
   r   r	   r   s       r   Úsend_responsezAsyncHttpConsumer.send_response.   sb   è è € ð  ˆdÔÐ8Ð8 vÐ8°Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ð8Ø�nŠn˜TÑ"Ô"Ð"Ð"Ð"Ð"Ð"Ð"Ð"Ð"Ð"r   c              ƒ   ó$   K  — t          d¦  «        ‚)z·
        Receives the request body as a bytestring. Response may be composed
        using the ``self.send*`` methods; the return value of this method is
        thrown away.
        z?Subclasses of AsyncHttpConsumer must provide a handle() method.)ÚNotImplementedError)r
   r	   s     r   ÚhandlezAsyncHttpConsumer.handle7   s   è è € õ "ØMñ
ô 
ð 	
r   c              ƒ   ó
   K  — dS )zh
        Overrideable place to run disconnect handling. Do not send anything
        from here.
        Nr    )r
   s    r   Ú
disconnectzAsyncHttpConsumer.disconnectA   s   è è € ð
 	ˆr   c              ƒ   ót  K  — d|v r | j                              |d         ¦  «         |                     d¦  «        s|	 |                      d                     | j         ¦  «        ¦  «        ƒ d{V —† |                      ¦   «         ƒ d{V —† n# |                      ¦   «         ƒ d{V —† w xY wt          ¦   «         ‚dS )z�
        Async entrypoint - concatenates body fragments and hands off control
        to ``self.handle`` when the body has been completely received.
        r	   r   r   N)r	   ÚappendÚgetr$   Újoinr&   r   ©r
   Úmessages     r   Úhttp_requestzAsyncHttpConsumer.http_requestH   sÙ   è è € ð
 �WÐÐØŒI×Ò˜W Vœ_Ñ-Ô-Ð-Ø�{Š{˜;Ñ'Ô'ð 	!ð(Ø—k’k #§(¢(¨4¬9Ñ"5Ô"5Ñ6Ô6Ð6Ð6Ð6Ð6Ð6Ð6Ð6à—o’oÑ'Ô'Ð'Ð'Ð'Ð'Ð'Ð'Ð'Ð'ø�d—o’oÑ'Ô'Ð'Ð'Ð'Ð'Ð'Ð'Ð'Ð'øøøÝ‘.”.Ð ð	!ð 	!s   ½3B ÂB'c              ƒ   óV   K  — |                       ¦   «         ƒ d{V —† t          ¦   «         ‚)zG
        Let the user do their cleanup and close the consumer.
        N)r&   r   r+   s     r   Úhttp_disconnectz!AsyncHttpConsumer.http_disconnectV   s4   è è € ð �oŠoÑÔÐÐÐÐÐÐÐÝ‰nŒnÐr   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r!   r$   r&   r-   r/   r    r   r   r   r      s¶   € € € € € ðð ð
ð ð ð ,/¸ð 
ð 
ð 
ð 
ð 
ð$ 27ð 
ð 
ð 
ð 
ð 
ð#ð #ð #ð
ð 
ð 
ðð ð ð!ð !ð !ðð ð ð ð r   r   N)Úchannels.consumerr   Ú
exceptionsr   r   r    r   r   ú<module>r6      sg   ðØ +Ð +Ð +Ð +Ð +Ð +à %Ð %Ð %Ð %Ð %Ð %ðUð Uð Uð Uð U˜ñ Uô Uð Uð Uð Ur   