§
    TøÁioj  ã                  ó   — d dl mZ d dlZd dlZd dlZd dlmZ ddlmZm	Z	m
Z
mZmZmZ ddlmZ ddlmZmZmZmZmZmZmZmZmZmZ ddlmZmZ dd	lmZ dd
l m!Z!m"Z"m#Z#m$Z$ g d¢Z%eez  ez  Z&	  G d„ dej'        ¦  «        Z(e(j)        Z)e(j*        Z* G d„ dej'        ¦  «        Z+e+j,        Z,e+j-        Z-e+j.        Z.e+j/        Z/dZ0	  G d„ d¦  «        Z1dS )é    )ÚannotationsN)Ú	Generatoré   )ÚConnectionClosedÚConnectionClosedErrorÚConnectionClosedOKÚInvalidStateÚPayloadTooBigÚProtocolError)Ú	Extension)
ÚOK_CLOSE_CODESÚ	OP_BINARYÚOP_CLOSEÚOP_CONTÚOP_PINGÚOP_PONGÚOP_TEXTÚCloseÚ	CloseCodeÚFrame)ÚRequestÚResponse)ÚStreamReader)Ú	BytesLikeÚ
LoggerLikeÚOriginÚSubprotocol)ÚProtocolÚSideÚStateÚSEND_EOFc                  ó.   — e Zd ZdZ ed¦  «        \  ZZdS )r   z6A WebSocket connection is either a server or a client.é   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚrangeÚSERVERÚCLIENT© ó    ú]/var/www/html/jarvis.com/web/backend/venv/lib/python3.11/site-packages/websockets/protocol.pyr   r   -   s%   € € € € € Ø@Ð@à�U˜1‘X”X�N€FˆFˆFˆFr,   r   c                  ó2   — e Zd ZdZ ed¦  «        \  ZZZZdS )r    z6A WebSocket connection is in one of these four states.é   N)	r$   r%   r&   r'   r(   Ú
CONNECTINGÚOPENÚCLOSINGÚCLOSEDr+   r,   r-   r    r    7   s*   € € € € € Ø@Ð@à(-¨¨a©¬Ñ%€J��g˜v˜v˜vr,   r    r,   c                  ó6  — e Zd ZdZedddœd:d„Zed;d„¦   «         Zej        d<d„¦   «         Zed=d„¦   «         Z	ed>d„¦   «         Z
ed?d„¦   «         Zd@d„ZdAd„ZdBd„ZdCdBd!„ZdCdBd"„ZdDdEd(„ZdFd)„ZdFd*„ZdGdHd,„ZdId.„ZdJd0„ZdKd1„ZdLd3„ZdLd4„ZdMd7„ZdMd8„ZdAd9„ZdS )Nr   a÷  
    Sans-I/O implementation of a WebSocket connection.

    Args:
        side: :attr:`~Side.CLIENT` or :attr:`~Side.SERVER`.
        state: Initial state of the WebSocket connection.
        max_size: Maximum size of incoming messages in bytes.
            :obj:`None` disables the limit. You may pass a ``(max_message_size,
            max_fragment_size)`` tuple to set different limits for messages and
            fragments when you expect long messages sent in short fragments.
        logger: Logger for this connection; depending on ``side``,
            defaults to ``logging.getLogger("websockets.client")``
            or ``logging.getLogger("websockets.server")``;
            see the :doc:`logging guide <../../topics/logging>` for details.

    i   N)ÚstateÚmax_sizeÚloggerÚsider   r5   r    r6   ú*tuple[int | None, int | None] | int | Noner7   úLoggerLike | NoneÚreturnÚNonec               ó°  — t          j        ¦   «         | _        	 |€.t          j        d|j                             ¦   «         › �¦  «        }|| _        	 |                     t          j	        ¦  «        | _
        || _        || _        t          |t          ¦  «        s|€|d c| _        | _        n|\  | _        | _        d | _        d| _        d | _        g | _        d | _        d | _        d | _        d | _        d | _        	 d| _        t7          ¦   «         | _        g | _        g | _        |                      ¦   «         | _         tC          | j         ¦  «         d | _"        d S )Nzwebsockets.F)#ÚuuidÚuuid4ÚidÚloggingÚ	getLoggerÚnameÚlowerr7   ÚisEnabledForÚDEBUGÚdebugr8   r5   Ú
isinstanceÚintÚmax_message_sizeÚmax_fragment_sizeÚcurrent_sizeÚexpect_continuation_frameÚoriginÚ
extensionsÚsubprotocolÚ
close_rcvdÚ
close_sentÚclose_rcvd_then_sentÚhandshake_excÚeof_sentr   ÚreaderÚeventsÚwritesÚparseÚparserÚnextÚ
parser_exc)Úselfr8   r5   r6   r7   s        r-   Ú__init__zProtocol.__init__Y   sU  € õ "œZ™\œ\ˆŒØBð ˆ>ÝÔ&Ð'H°T´Y·_²_Ñ5FÔ5FÐ'HÐ'HÑIÔIˆFØ"(ˆŒØ)ð ×(Ò(­¬Ñ7Ô7ˆŒ
ð ˆŒ	ð ˆŒ
õ �h¥Ñ$Ô$ð 	E¨Ð(8Ø<DÀdÐ9ˆDÔ! 4Ô#9Ð#9à<DÑ9ˆDÔ! 4Ô#9ð )-ˆÔð */ˆÔ&ð &*ˆŒØ+-ˆŒØ/3ˆÔð )-ˆŒØ(,ˆŒØ15ˆÔ!ð 04ˆÔð	ð ˆŒõ #‘n”nˆŒØ#%ˆŒØ#%ˆŒØ—j’j‘l”lˆŒÝˆTŒ[ÑÔÐØ,0ˆŒˆˆr,   c                ó   — | j         S )a­  
        State of the WebSocket connection.

        Defined in 4.1_, 4.2_, 7.1.3_, and 7.1.4_ of :rfc:`6455`.

        .. _4.1: https://datatracker.ietf.org/doc/html/rfc6455#section-4.1
        .. _4.2: https://datatracker.ietf.org/doc/html/rfc6455#section-4.2
        .. _7.1.3: https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.3
        .. _7.1.4: https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4

        )Ú_state©r]   s    r-   r5   zProtocol.state    s   € ð Œ{Ðr,   c                ób   — | j         r | j                              d|j        ¦  «         || _        d S )Nz= connection is %s)rG   r7   rC   r`   )r]   r5   s     r-   r5   zProtocol.state¯   s3   € àŒ:ð 	@ØŒK×ÒÐ2°E´JÑ?Ô?Ð?ØˆŒˆˆr,   ú
int | Nonec                ó`   — | j         t          urdS | j        €t          j        S | j        j        S )zþ
        WebSocket close code received from the remote endpoint.

        Defined in 7.1.5_ of :rfc:`6455`.

        .. _7.1.5: https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5

        :obj:`None` if the connection isn't closed yet.

        N)r5   r3   rQ   r   ÚABNORMAL_CLOSUREÚcodera   s    r-   Ú
close_codezProtocol.close_codeµ   s2   € ð Œ:�VÐ#Ð#Ø�4ØŒ_Ð$ÝÔ-Ð-à”?Ô'Ð'r,   ú
str | Nonec                óL   — | j         t          urdS | j        €dS | j        j        S )a  
        WebSocket close reason  received from the remote endpoint.

        Defined in 7.1.6_ of :rfc:`6455`.

        .. _7.1.6: https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6

        :obj:`None` if the connection isn't closed yet.

        NÚ )r5   r3   rQ   Úreasonra   s    r-   Úclose_reasonzProtocol.close_reasonÈ   s.   € ð Œ:�VÐ#Ð#Ø�4ØŒ_Ð$Ø�2à”?Ô)Ð)r,   r   c                ó  — | j         t          u s
J d¦   «         ‚| j        �5| j        �.| j        j        t
          v r| j        j        t
          v rt          }nt          } || j        | j        | j        ¦  «        }| j	        |_
        |S )aè  
        Exception to raise when trying to interact with a closed connection.

        Don't raise this exception while the connection :attr:`state`
        is :attr:`~websockets.protocol.State.CLOSING`; wait until
        it's :attr:`~websockets.protocol.State.CLOSED`.

        Indeed, the exception includes the close code and reason, which are
        known only once the connection is closed.

        Raises:
            AssertionError: If the connection isn't closed yet.

        zconnection isn't closed yet)r5   r3   rQ   rR   rf   r   r   r   rS   r\   Ú	__cause__)r]   Úexc_typeÚexcs      r-   Ú	close_exczProtocol.close_excÛ   s�   € ð  Œz�VÐ#Ð#Ð#Ð%BÑ#Ô#Ð#ð ŒOÐ'Ø”Ð+Ø”Ô$­Ð6Ð6Ø”Ô$­Ð6Ð6å)ˆHˆHå,ˆHØ ( ØŒOØŒOØÔ%ñ!
ô !
ˆð œˆŒØˆ
r,   Údataúbytes | bytearrayc                ób   — | j                              |¦  «         t          | j        ¦  «         dS )aH  
        Receive data from the network.

        After calling this method:

        - You must call :meth:`data_to_send` and send this data to the network.
        - You should call :meth:`events_received` and process resulting events.

        Raises:
            EOFError: If :meth:`receive_eof` was called earlier.

        N)rV   Ú	feed_datar[   rZ   ©r]   rr   s     r-   Úreceive_datazProtocol.receive_data  s0   € ð 	Œ×Ò˜dÑ#Ô#Ð#ÝˆTŒ[ÑÔÐÐÐr,   c                ó|   — | j         j        rdS | j                              ¦   «          t          | j        ¦  «         dS )a¡  
        Receive the end of the data stream from the network.

        After calling this method:

        - You must call :meth:`data_to_send` and send this data to the network;
          it will return ``[b""]``, signaling the end of the stream, or ``[]``.
        - You aren't expected to call :meth:`events_received`; it won't return
          any new events.

        :meth:`receive_eof` is idempotent.

        N)rV   ÚeofÚfeed_eofr[   rZ   ra   s    r-   Úreceive_eofzProtocol.receive_eof  s?   € ð Œ;Œ?ð 	ØˆFØŒ×ÒÑÔÐÝˆTŒ[ÑÔÐÐÐr,   r   ÚfinÚboolc                ó  — | j         st          d¦  «        ‚| j        t          ur.t	          d| j        j                             ¦   «         › �¦  «        ‚| | _         |                      t          t          ||¦  «        ¦  «         dS )aõ  
        Send a `Continuation frame`_.

        .. _Continuation frame:
            https://datatracker.ietf.org/doc/html/rfc6455#section-5.6

        Parameters:
            data: payload containing the same kind of data
                as the initial frame.
            fin: FIN bit; set it to :obj:`True` if this is the last frame
                of a fragmented message and to :obj:`False` otherwise.

        Raises:
            ProtocolError: If a fragmented message isn't in progress.

        úunexpected continuation frameúconnection is N)rM   r   r`   r1   r	   r5   rC   rD   Ú
send_framer   r   ©r]   rr   r|   s      r-   Úsend_continuationzProtocol.send_continuation&  s�   € ð" Ô-ð 	AÝÐ ?Ñ@Ô@Ð@ØŒ;�dÐ"Ð"ÝÐI°´
´×0EÒ0EÑ0GÔ0GÐIÐIÑJÔJÐJØ-0¨ˆÔ&Ø�Š��g t¨SÑ1Ô1Ñ2Ô2Ð2Ð2Ð2r,   Tc                ó  — | j         rt          d¦  «        ‚| j        t          ur.t	          d| j        j                             ¦   «         › �¦  «        ‚| | _         |                      t          t          ||¦  «        ¦  «         dS )a£  
        Send a `Text frame`_.

        .. _Text frame:
            https://datatracker.ietf.org/doc/html/rfc6455#section-5.6

        Parameters:
            data: payload containing text encoded with UTF-8.
            fin: FIN bit; set it to :obj:`False` if this is the first frame of
                a fragmented message.

        Raises:
            ProtocolError: If a fragmented message is in progress.

        úexpected a continuation framer€   N)rM   r   r`   r1   r	   r5   rC   rD   r�   r   r   r‚   s      r-   Ú	send_textzProtocol.send_text>  s�   € ð  Ô)ð 	AÝÐ ?Ñ@Ô@Ð@ØŒ;�dÐ"Ð"ÝÐI°´
´×0EÒ0EÑ0GÔ0GÐIÐIÑJÔJÐJØ-0¨ˆÔ&Ø�Š��g t¨SÑ1Ô1Ñ2Ô2Ð2Ð2Ð2r,   c                ó  — | j         rt          d¦  «        ‚| j        t          ur.t	          d| j        j                             ¦   «         › �¦  «        ‚| | _         |                      t          t          ||¦  «        ¦  «         dS )a¥  
        Send a `Binary frame`_.

        .. _Binary frame:
            https://datatracker.ietf.org/doc/html/rfc6455#section-5.6

        Parameters:
            data: payload containing arbitrary binary data.
            fin: FIN bit; set it to :obj:`False` if this is the first frame of
                a fragmented message.

        Raises:
            ProtocolError: If a fragmented message is in progress.

        r…   r€   N)rM   r   r`   r1   r	   r5   rC   rD   r�   r   r   r‚   s      r-   Úsend_binaryzProtocol.send_binaryU  s�   € ð  Ô)ð 	AÝÐ ?Ñ@Ô@Ð@ØŒ;�dÐ"Ð"ÝÐI°´
´×0EÒ0EÑ0GÔ0GÐIÐIÑJÔJÐJØ-0¨ˆÔ&Ø�Š��i¨¨sÑ3Ô3Ñ4Ô4Ð4Ð4Ð4r,   rj   rf   úCloseCode | int | Nonerk   Ústrc                ó¶  — | j         t          ur.t          d| j        j                             ¦   «         › �¦  «        ‚|€2|dk    rt          d¦  «        ‚t          t          j	        d¦  «        }d}n$t          ||¦  «        }| 
                    ¦   «         }|                      t          t          |¦  «        ¦  «         | j        �J ‚|| _        t           | _        dS )a_  
        Send a `Close frame`_.

        .. _Close frame:
            https://datatracker.ietf.org/doc/html/rfc6455#section-5.5.1

        Parameters:
            code: close code.
            reason: close reason.

        Raises:
            ProtocolError: If the code isn't valid or if a reason is provided
                without a code.

        r€   Nrj   z#cannot send a reason without a coder,   )r`   r1   r	   r5   rC   rD   r   r   r   ÚNO_STATUS_RCVDÚ	serializer�   r   r   rQ   rR   r2   ©r]   rf   rk   Úcloserr   s        r-   Ú
send_closezProtocol.send_closel  sÊ   € ð$ Œ;�dÐ"Ð"ÝÐI°´
´×0EÒ0EÑ0GÔ0GÐIÐIÑJÔJÐJØˆ<Ø˜Š|ˆ|Ý#Ð$IÑJÔJÐJÝ�)Ô2°BÑ7Ô7ˆEØˆDˆDå˜$ Ñ'Ô'ˆEØ—?’?Ñ$Ô$ˆDà�Š��h¨Ñ-Ô-Ñ.Ô.Ð.ð ŒÐ&Ð&Ð&ØˆŒÝˆŒ
ˆ
ˆ
r,   c                óê   — | j         t          ur<| j         t          ur.t          d| j        j                             ¦   «         › �¦  «        ‚|                      t          t          |¦  «        ¦  «         dS )zÚ
        Send a `Ping frame`_.

        .. _Ping frame:
            https://datatracker.ietf.org/doc/html/rfc6455#section-5.5.2

        Parameters:
            data: payload containing arbitrary binary data.

        r€   N)
r`   r1   r2   r	   r5   rC   rD   r�   r   r   rv   s     r-   Ú	send_pingzProtocol.send_ping�  óf   € ð Œ;�dÐ"Ð" t¤{½'Ð'AÐ'AÝÐI°´
´×0EÒ0EÑ0GÔ0GÐIÐIÑJÔJÐJØ�Š��g tÑ,Ô,Ñ-Ô-Ð-Ð-Ð-r,   c                óê   — | j         t          ur<| j         t          ur.t          d| j        j                             ¦   «         › �¦  «        ‚|                      t          t          |¦  «        ¦  «         dS )zÚ
        Send a `Pong frame`_.

        .. _Pong frame:
            https://datatracker.ietf.org/doc/html/rfc6455#section-5.5.3

        Parameters:
            data: payload containing arbitrary binary data.

        r€   N)
r`   r1   r2   r	   r5   rC   rD   r�   r   r   rv   s     r-   Ú	send_pongzProtocol.send_pong   r“   r,   úCloseCode | intc                óÈ  — | j         t          u r}|t          j        k    rmt	          ||¦  «        }|                     ¦   «         }|                      t          t          |¦  «        ¦  «         || _	        | j
        �d| _        t          | _         | j        t          u r| j        s|                      ¦   «          |                      ¦   «         | _        t'          | j        ¦  «         dS )a?  
        `Fail the WebSocket connection`_.

        .. _Fail the WebSocket connection:
            https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.7

        Parameters:
            code: close code
            reason: close reason

        Raises:
            ProtocolError: If the code isn't valid.
        NT)r5   r1   r   re   r   r�   r�   r   r   rR   rQ   rS   r2   r8   r)   rU   Úsend_eofÚdiscardrZ   r[   rŽ   s        r-   ÚfailzProtocol.fail°  sÃ   € ð& Œ:�ÐÐØ•yÔ1Ò1Ð1Ý˜d FÑ+Ô+�Ø—’Ñ(Ô(�Ø—’¥¥h°Ñ 5Ô 5Ñ6Ô6Ð6Ø"'�”ð
 ”?Ð.Ø04�DÔ-Ý$�”
ð Œ9�ÐÐ t¤}ÐØ�MŠM‰OŒOˆOð —l’l‘n”nˆŒÝˆTŒ[ÑÔÐÐÐr,   úlist[Event]c                ó$   — | j         g c}| _         |S )a*  
        Fetch events generated from data received from the network.

        Call this method immediately after any of the ``receive_*()`` methods.

        Process resulting events, likely by passing them to the application.

        Returns:
            Events read from the connection.
        )rW   )r]   rW   s     r-   Úevents_receivedzProtocol.events_receivedá  s   € ð #œk¨2Ðˆ�”Øˆr,   úlist[bytes]c                ó$   — | j         g c}| _         |S )aÉ  
        Obtain data to send to the network.

        Call this method immediately after any of the ``receive_*()``,
        ``send_*()``, or :meth:`fail` methods.

        Write resulting data to the connection.

        The empty bytestring :data:`~websockets.protocol.SEND_EOF` signals
        the end of the data stream. When you receive it, half-close the TCP
        connection.

        Returns:
            Data to write to the connection.

        )rX   )r]   rX   s     r-   Údata_to_sendzProtocol.data_to_sendñ  s   € ð" #œk¨2Ðˆ�”Øˆr,   c                ó�   — | j         t          u rdS | j         t          u rdS | j         t          u rdS | j         t          u sJ ‚| j        S )a©  
        Tell if the TCP connection is expected to close soon.

        Call this method immediately after any of the ``receive_*()``,
        ``send_close()``, or :meth:`fail` methods.

        If it returns :obj:`True`, schedule closing the TCP connection after a
        short timeout if the other side hasn't already closed it.

        Returns:
            Whether the TCP connection is expected to close soon.

        FT)r5   r1   r2   r3   r0   rU   ra   s    r-   Úclose_expectedzProtocol.close_expected  sV   € ðD Œ:�ÐÐØ�5ØŒ:�Ð Ð Ø�4ØŒ:�ÐÐØ�5ØŒz�ZÐ'Ð'Ð'Ð'ØŒ}Ðr,   úGenerator[None]c              #  ój  K  — 	 	 | j                              ¦   «         E d{V —†r0| j        r| j                             d¦  «         t	          d¦  «        ‚d}| j        �| j        €| j        }n| j        | j        z
  }| j        �|€| j        }nt          || j        ¦  «        }t          j
        | j         j        | j        t          u || j        ¬¦  «        E d{V —†}| j        r| j                             d|¦  «         |                      |¦  «         �Œ# t           $ r?}|                      t$          j        t)          |¦  «        ¦  «         || _        Y d}~�nKd}~wt          $ r?}|                      t$          j        t)          |¦  «        ¦  «         || _        Y d}~�nd}~wt.          $ r@}|                      t$          j        |j        › d|j        › �¦  «         || _        Y d}~n¼d}~wt6          $ rX}|                     | j        ¦  «         |                      t$          j        t)          |¦  «        ¦  «         || _        Y d}~n\d}~wt<          $ rL}| j                             dd¬	¦  «         |                      t$          j         ¦  «         || _        Y d}~nd}~ww xY wdV — tC          d
¦  «        ‚)a-  
        Parse incoming data into frames.

        :meth:`receive_data` and :meth:`receive_eof` run this generator
        coroutine until it needs more data or reaches EOF.

        :meth:`parse` never raises an exception. Instead, it sets the
        :attr:`parser_exc` and yields control.

        TNú< EOFzunexpected end of stream)Úmaskr6   rO   z< %sz at position zparser failed)Úexc_infoz"parse() shouldn't step after error)"rV   Úat_eofrG   r7   ÚEOFErrorrJ   rL   rK   Úminr   rY   Ú
read_exactr8   r)   rO   Ú
recv_framer   rš   r   ÚPROTOCOL_ERRORrŠ   r\   re   ÚUnicodeDecodeErrorÚINVALID_DATArk   Ústartr
   Úset_current_sizeÚMESSAGE_TOO_BIGÚ	ExceptionÚerrorÚINTERNAL_ERRORÚAssertionError)r]   r6   Úframerp   s       r-   rY   zProtocol.parse2  s  è è € ð=	"ð%'Ø#œ{×1Ò1Ñ3Ô3Ð3Ð3Ð3Ð3Ð3Ð3ð ?Ø”zð 3Øœ×)Ò)¨'Ñ2Ô2Ð2õ
 #Ð#=Ñ>Ô>Ð>à�àÔ(Ð4ØÔ(Ð0Ø#'Ô#8˜˜à#'Ô#8¸4Ô;LÑ#L˜àÔ)Ð5ØÐ'Ø#'Ô#9˜˜å#& x°Ô1GÑ#HÔ#H˜õ
 $)¤;Ø”KÔ*Øœ¥fÐ,Ø%Ø#œð	$ñ $ô $ð ð ð ð ð ð �ð ”:ð 5Ø”K×%Ò% f¨eÑ4Ô4Ð4à—’ Ñ&Ô&Ð&ñK%'øõN ð 	"ð 	"ð 	"Ø�IŠI•iÔ.µ°C±´Ñ9Ô9Ð9Ø!ˆDŒOˆOˆOˆOˆO‰Oøøøøåð 	"ð 	"ð 	"Ø�IŠI•iÔ0µ#°c±(´(Ñ;Ô;Ð;Ø!ˆDŒOˆOˆOˆOˆO‰Oøøøøå!ð 	"ð 	"ð 	"Ø�IŠI•iÔ,°´Ð.UÐ.UÈ#Ì)Ð.UÐ.UÑVÔVÐVØ!ˆDŒOˆOˆOˆOˆOˆOøøøøåð 	"ð 	"ð 	"Ø× Ò  Ô!2Ñ3Ô3Ð3Ø�IŠI•iÔ/µ°S±´Ñ:Ô:Ð:Ø!ˆDŒOˆOˆOˆOˆOˆOøøøøåð 	"ð 	"ð 	"ØŒK×Ò˜o¸ÐÑ=Ô=Ð=à�IŠI•iÔ.Ñ/Ô/Ð/Ø!ˆDŒOˆOˆOˆOˆOˆOøøøøð		"øøøð 	ˆˆˆÝÐAÑBÔBÐBsJ   „DD Ä
JÄ4EÅJÅ$4FÆJÆ+6G&Ç&JÇ3AIÉJÉAJÊJc              #  óâ  K  — | j         t          u p| j        t          u | j        k    sJ ‚| j                             ¦   «         E d{V —†s8| j                             ¦   «          | j                             ¦   «         E d{V —†¯8| j        r| j	                             d¦  «         | j         t          u r"| j        t          ur|                      ¦   «          t          | _        dV — t          d¦  «        ‚)zí
        Discard incoming data.

        This coroutine replaces :meth:`parse`:

        - after receiving a close frame, during a normal closure (1.4);
        - after sending a close frame, during an abnormal closure (7.1.7).

        Nr¥   z"discard() shouldn't step after EOF)r8   r)   r5   r0   rU   rV   r¨   r™   rG   r7   r*   r˜   r3   r¶   ra   s    r-   r™   zProtocol.discard�  sý   è è € ð ”	�VÐ#Ð? t¤zµZÐ'?ÀTÄ]ÒSÐSÐSÐSØ"œk×0Ò0Ñ2Ô2Ð2Ð2Ð2Ð2Ð2Ð2ð 	"ØŒK×ÒÑ!Ô!Ð!ð #œk×0Ò0Ñ2Ô2Ð2Ð2Ð2Ð2Ð2Ð2ð 	"àŒ:ð 	'ØŒK×Ò˜gÑ&Ô&Ð&ð Œ9�ÐÐ 4¤:µZÐ#?Ð#?Ø�MŠM‰OŒOˆOÝˆŒ
àˆˆˆõ ÐAÑBÔBÐBr,   r·   r   c                ót  — |j         t          u s|j         t          u r8| j        �t	          d¦  «        ‚|j        st          |j        ¦  «        | _        �nÉ|j         t          u rJ| j        €t	          d¦  «        ‚|j        r	d| _        �n•| xj        t          |j        ¦  «        z  c_        �nq|j         t          u r1t          t          |j        ¦  «        }|                      |¦  «         �n2|j         t          u r�n"|j         t          u rüt          j        |j        ¦  «        | _        | j        t$          u r| j        €J ‚d| _        | j        �t	          d¦  «        ‚| j        t*          u rL|                      t          t          |j        ¦  «        ¦  «         | j        | _        d| _        t$          | _        | j        t.          u r|                      ¦   «          |                      ¦   «         | _        t7          | j        ¦  «         nt9          d|j         d›�¦  «        ‚| j                             |¦  «         dS )	z-
        Process an incoming frame.

        Nr…   r   Fzincomplete fragmented messageTzunexpected opcode: Ú02x)Úopcoder   r   rL   r   r|   Úlenrr   r   r   r   r   r�   r   r   rY   rQ   r5   r2   rR   rS   r1   r8   r)   r˜   r™   rZ   r[   r¶   rW   Úappend)r]   r·   Ú
pong_frames      r-   r¬   zProtocol.recv_frameŸ  s  € ð
 Œ<�7Ð"Ð" e¤lµiÐ&?Ð&?ØÔ Ð,Ý#Ð$CÑDÔDÐDØ”9ð 4Ý$'¨¬
¡O¤O�Ô!ùàŒ\�WÐ$Ð$ØÔ Ð(Ý#Ð$CÑDÔDÐDØŒyð 5Ø$(�Ô!Ñ!àÐ!Ô!¥S¨¬¡_¤_Ñ4Ð!Ô!Ñ!àŒ\�WÐ$Ð$õ �w¨¬
Ñ3Ô3ˆJØ�OŠO˜JÑ'Ô'Ð'Ñ'àŒ\�WÐ$Ð$ñ àŒ\�XÐ%Ð%õ $œk¨%¬*Ñ5Ô5ˆDŒOØŒz�WÐ$Ð$Ø”Ð2Ð2Ð2Ø,1�Ô)àÔ Ð,Ý#Ð$CÑDÔDÐDð Œz�TÐ!Ð!ð
 —’¥¥h°´
Ñ ;Ô ;Ñ<Ô<Ð<Ø"&¤/�”Ø,0�Ô)Ý$�”
ð Œy�FÐ"Ð"Ø—’‘”�ð Ÿ,š,™.œ.ˆDŒKÝ�”ÑÔÐÐõ !Ð!I°u´|Ð!IÐ!IÐ!IÑJÔJÐJàŒ×Ò˜5Ñ!Ô!Ð!Ð!Ð!r,   c                óÊ   — | j         r| j                              d|¦  «         | j                             |                     | j        t          u | j        ¬¦  «        ¦  «         d S )Nz> %s)r¦   rO   )rG   r7   rX   r½   r�   r8   r*   rO   )r]   r·   s     r-   r�   zProtocol.send_frameñ  sm   € ØŒ:ð 	-ØŒK×Ò˜f eÑ,Ô,Ð,ØŒ×ÒØ�OŠOØ”Y¥&Ð(Øœ?ð ñ ô ñ	
ô 	
ð 	
ð 	
ð 	
r,   c                ó¦   — | j         rJ ‚d| _         | j        r| j                             d¦  «         | j                             t
          ¦  «         d S )NTz> EOF)rU   rG   r7   rX   r½   r!   ra   s    r-   r˜   zProtocol.send_eofû  sS   € Ø”=Ð Ð Ð ØˆŒØŒ:ð 	'ØŒK×Ò˜gÑ&Ô&Ð&ØŒ×Ò�8Ñ$Ô$Ð$Ð$Ð$r,   )
r8   r   r5   r    r6   r9   r7   r:   r;   r<   )r;   r    )r5   r    r;   r<   )r;   rc   )r;   rh   )r;   r   )rr   rs   r;   r<   )r;   r<   )rr   r   r|   r}   r;   r<   )T)Nrj   )rf   r‰   rk   rŠ   r;   r<   )rr   r   r;   r<   )rj   )rf   r–   rk   rŠ   r;   r<   )r;   r›   )r;   rž   )r;   r}   )r;   r£   )r·   r   r;   r<   )r$   r%   r&   r'   r1   r^   Úpropertyr5   Úsetterrg   rl   rq   rw   r{   rƒ   r†   rˆ   r�   r’   r•   rš   r�   r    r¢   rY   r™   r¬   r�   r˜   r+   r,   r-   r   r   G   sn  € € € € € ðð ð* Ø?DØ$(ðE1ð E1ð E1ð E1ð E1ð E1ðN ðð ð ñ „Xðð „\ðð ð ñ „\ðð
 ð(ð (ð (ñ „Xð(ð$ ð*ð *ð *ñ „Xð*ð$ ð!ð !ð !ñ „Xð!ðJð ð ð ð ð ð ð ð*3ð 3ð 3ð 3ð03ð 3ð 3ð 3ð 3ð.5ð 5ð 5ð 5ð 5ð."ð "ð "ð "ð "ðH.ð .ð .ð .ð .ð .ð .ð .ð -ð -ð -ð -ð -ðbð ð ð ð ð ð ð ð()ð )ð )ð )ðZMCð MCð MCð MCð^Cð Cð Cð Cð<N"ð N"ð N"ð N"ðd
ð 
ð 
ð 
ð%ð %ð %ð %ð %ð %r,   r   )2Ú
__future__r   ÚenumrA   r>   Úcollections.abcr   Ú
exceptionsr   r   r   r	   r
   r   rO   r   Úframesr   r   r   r   r   r   r   r   r   r   Úhttp11r   r   Ústreamsr   Útypingr   r   r   r   Ú__all__ÚEventÚIntEnumr   r)   r*   r    r0   r1   r2   r3   r!   r   r+   r,   r-   ú<module>rÎ      sb  ðØ "Ð "Ð "Ð "Ð "Ð "à €€€Ø €€€Ø €€€Ø %Ð %Ð %Ð %Ð %Ð %ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð "Ð !Ð !Ð !Ð !Ð !ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð &Ð %Ð %Ð %Ð %Ð %Ð %Ð %Ø !Ð !Ð !Ð !Ð !Ð !Ø >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >Ð >ðð ð €ð 	�(Ñ˜UÑ"€Ø ?ðð ð ð ð ˆ4Œ<ñ ô ð ð 
Œ€Ø	Œ€ð1ð 1ð 1ð 1ð 1ˆDŒLñ 1ô 1ð 1ð Ô€
Ø„z€Ø
Œ-€Ø	Œ€ð €Ø Eðy
%ð y
%ð y
%ð y
%ð y
%ñ y
%ô y
%ð y
%ð y
%ð y
%r,   