o
    �õ±j  ã                   @   s*   d dl Z d	dd„Zd	dd„Zd
dd„ZdS )é    Nc                 Ã   óH   �t jt j|  |¡|d�gddiŽI dH }t|d tƒr |d S |d ‚)a6  
	Helper function to read exactly N amount of data from the wire.
	:param reader: The reader object
	:type reader: asyncio.StreamReader
	:param n: The maximum amount of bytes to read.
	:type n: int
	:param timeout: Time in seconds to wait for the reader to return data
	:type timeout: int
	:return: bytearray
	©ÚtimeoutÚreturn_exceptionsTNr   )ÚasyncioÚgatherÚwait_forÚreadexactlyÚ
isinstanceÚbytes©ÚreaderÚnr   Útemp© r   úŽ/root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/asysocks/common/aiowrappers.pyÚreadexactly_or_exc   s
   €(r   c                 Ã   r   )ak  
	Helper function to read N amount of data from the wire.
	:param reader: The reader object
	:type reader: asyncio.StreamReader
	:param n: The maximum amount of bytes to read. BEWARE: this only sets an upper limit of the data to be read
	:type n: int
	:param timeout: Time in seconds to wait for the reader to return data
	:type timeout: int
	:return: bytearray
	r   r   TNr   )r   r   r   Úreadr
   r   r   r   r   r   Úread_or_exc   ó
   €(r   ó   
c                 Ã   r   )aj  
	Helper function to read stream until separator is hit.
	:param reader: The reader object
	:type reader: asyncio.StreamReader
	:param n: The maximum amount of bytes to read. BEWARE: this only sets an upper limit of the data to be read
	:type n: int
	:param timeout: Time in seconds to wait for the reader to return data
	:type timeout: int
	:return: bytearray
	r   r   TNr   )r   r   r   Ú	readuntilr
   r   )r   Ú	separatorr   r   r   r   r   Úreaduntil_or_exc'   r   r   )N)r   N)r   r   r   r   r   r   r   r   Ú<module>   s    

