+
    iAo  c                   s   Rt ^ RIt^ RIt^ RIt^ RIt^ RIt]! ]R4      '       d
   ] R,          t ^RIHt ^RIH	t	 ^RIH
t
 ^RIHt ^R	IHt ^R
IHt ^RIHt RtRR]/R lltRR]/R llt]! ]R4      '       d   RR]/R lltRR]/R llt ! R R]P,                  4      t ! R R]]P,                  4      t ! R R4      t ! R R 4      tR# )StreamReaderStreamWriterStreamReaderProtocolNZAF_UNIX)
coroutines)events)
exceptions)format_helpers)	protocols)logger)sleeplimitc                s   a	"   \         P                  ! 4       p\        W$R 7      p\        WTR7      o	VP                  ! V	3R lW3/ VB G Rj  xL
 w  rg\        VS	WT4      pWX3#  L5i)r
   loopr   c                     < S # N protocol   (/usr/lib64/python3.14/asyncio/streams.py<lambda>Z!open_connection.<locals>.<lambda>1   s        N)r   get_running_loopr    r   Zcreate_connectionr   )
hostportr
   kwdsr   reader	transport_writerr   s
   &&$,     @r   open_connectionr      si     & ""$D1F#F6H//$.(,. .LI)Xv<F>.   A	A%A#A%c                s   a aa"   \         P                  ! 4       oV VV3R  lpSP                  ! WQV3/ VB G Rj  xL
 #  L5i)c                  >   < \        SSR 7      p \        V SSR7      pV# r   r   r    r   r   r   client_connected_cbr
   r        r   factoryZstart_server.<locals>.factoryN   s&    E5'0C-13r   N)r   r   Zcreate_server)r%   r   r   r
   r   r'   r   s   f&&d, @r   start_serverr(   6   s;     , ""$D ##G4@4@@@@s   5A?Ac                s   a"   \         P                  ! 4       p\        WR 7      p\        WCR7      oVP                  ! V3R lV 3/ VB G Rj  xL
 w  rV\        VSWC4      pWG3#  L5i)r   r   c                  r   r   r   r   r   r   r   Z&open_unix_connection.<locals>.<lambda>b   s    Hr   N)r   r   r    r   Zcreate_unix_connectionr   )	pathr
   r   r   r   r   r   r   r   s	   &$,     @r   open_unix_connectionr*   Z   si      &&(E5':!88d,&*, ,	i6@~,r    c                s   a aa"   \         P                  ! 4       oV VV3R  lpSP                  ! WA3/ VB G Rj  xL
 #  L5i)c                  r!   r"   r#   r$   r&   r   r'   Z"start_unix_server.<locals>.factoryk   s&    !D9F+F4G157HOr   N)r   r   Zcreate_unix_server)r%   r)   r
   r   r'   r   s   f&d, @r   start_unix_serverr+   f   s9      &&(	 ,,WCdCCCCs   4A >A c                   sH   a  ] tR t^tt o R	R ltR tR tR tR tR t	Rt
V tR# )
FlowControlMixinNc                s    Vf   \         P                  ! 4       V n        MWn        RV n        \        P
                  ! 4       V n        RV n        R # )NF)r   get_event_loop_loop_pausedcollectionsZdeque_drain_waiters_connection_lost)selfr      &&r   __init__ZFlowControlMixin.__init__~   s<    <..0DJJ)//1 %r   c                s    R V n         V P                  P                  4       '       d   \        P                  ! RV 4       R# R# )Tz%r pauses writingN)r/   r.   	get_debugr   debugr3      &r   pause_writingZFlowControlMixin.pause_writing   s0    ::!!LL,d3 "r   c                s    R V n         V P                  P                  4       '       d   \        P                  ! RV 4       V P
                   F,  pVP                  4       '       d   K  VP                  R4       K.  	  R# )Fz%r resumes writingN)r/   r.   r6   r   r7   r1   done
set_resultr3   waiter   & r   resume_writingZFlowControlMixin.resume_writing   sT    ::!!LL-t4))F;;==!!$' *r   c                s    R V n         V P                  '       g   R# V P                   FC  pVP                  4       '       d   K  Vf   VP	                  R4       K2  VP                  V4       KE  	  R# TN)r2   r/   r1   r;   r<   set_exceptionr3   excr>      && r   connection_lostZ FlowControlMixin.connection_lost   sR     $|||))F;;==;%%d+((- *r   c                sj  "   V P                   '       d   \        R 4      hV P                  '       g   R# V P                  P	                  4       pV P
                  P                  V4        VG Rj  xL
  V P
                  P                  V4       R#  L!  T P
                  P                  T4       i ; i5i)zConnection lostN)r2   ZConnectionResetErrorr/   r.   create_futurer1   appendZremover=   r?   r   _drain_helperZFlowControlMixin._drain_helper   s        &'899|||))+""6*	/LL&&v. &&v.s4   /B37B3*B /B0B 4B3B B00B3c                s    \         hr   )NotImplementedErrorr3   Zstreamr4   r   _get_close_waiterZ"FlowControlMixin._get_close_waiter   s    !!r   )r2   r1   r.   r/   r   )__name__
__module____qualname____firstlineno__r5   r:   r@   rF   rI   rL   __static_attributes____classdictcell____classdict__   @r   r,   r,   t   s(     &4(.
/" "r   r,   c                   sz   a a ] tR t^t oRtRV 3R llt]R 4       tR tR t	V 3R lt
R tR tR	 tR
 tRtVtV ;t# )r   Nc                s.  < \         SV `  VR 7       Ve.   \        P                  ! V4      V n        VP
                  V n        MRV n        Ve   Wn        RV n        RV n        RV n	        W n
        RV n        V P                  P                  4       V n        R# )r   NF)superr5   weakrefZref_stream_reader_wr_source_traceback_strong_reader_reject_connection_task
_transport_client_connected_cb	_over_sslr.   rG   _closed)r3   Zstream_readerr%   r   	__class__s   &&&&r   r5   ZStreamReaderProtocol.__init__   s    d#$%,[[%?D"%2%D%DD"%)D"* #0"'
$7!zz//1r   c                sB    V P                   f   R # V P                  4       # r   )rX   r8   r9   r   _stream_readerZ#StreamReaderProtocol._stream_reader   s     !!)%%''r   c                sZ    V P                   pWn        VP                  R 4      RJV n        R# )
sslcontextN)r.   r]   get_extra_infor_   )r3   r   r   rE   r   _replace_transportZ'StreamReaderProtocol._replace_transport   s'    zz#"11,?tKr   c                s  a a S P                   '       dS   R R/pS P                  '       d   S P                  VR&   S P                  P                  V4       SP	                  4        R# SS n        S P                  pVe   VP                  S4       SP                  R4      RJS n	        S P                  e   \        SS VS P                  4      pS P                  W44      p\        P                  ! V4      '       dC   V V3R lpS P                  P                  V4      S n        S P                  P!                  V4       RS n        R# R# )messagezpAn open stream was garbage collected prior to establishing network connection; call "stream.close()" explicitly.Zsource_tracebackNrc   c                 s   < V P                  4       '       d   SP                  4        R # V P                  4       pVe4   SP                  P	                  RRRVRS/4       SP                  4        R # R # )Nrf   z*Unhandled exception in client_connected_cb	exceptionr   )	cancelledcloserg   r.   call_exception_handler)ZtaskrD   r3   r   s   & r   callbackZ6StreamReaderProtocol.connection_made.<locals>.callback   sf    ~~''!)..*C

99%'S''; 
 ") 'r   )r[   rY   r.   rj   Zabortr]   rb   set_transportrd   r_   r^   r   r   ZiscoroutineZcreate_taskr\   Zadd_done_callbackrZ   )r3   r   Zcontextr   r   Zresrk   s   ff     r   connection_madeZ$StreamReaderProtocol.connection_made   s   """ @G
 %%%.2.D.D*+JJ--g6OO#$$  +"11,?tK$$0!)T64::FF++F;C%%c*** "ZZ33C8


,,X6"&D) 1r   c                s  < V P                   pVe'   Vf   VP                  4        MVP                  V4       V P                  P	                  4       '       g<   Vf   V P                  P                  R 4       MV P                  P                  V4       \        SV `  V4       R V n        R V n	        R V n
        R V n        R # r   )rb   feed_eofrB   r`   r;   r<   rV   rF   rX   _stream_writerr\   r]   )r3   rD   r   ra   s   && r   rF   Z$StreamReaderProtocol.connection_lost  s    $${!$$S)||  ""{''-**3/$!%"
r   c                sL    V P                   pVe   VP                  V4       R # R # r   )rb   	feed_data)r3   datar   rE   r   data_receivedZ"StreamReaderProtocol.data_received  s&    $$T" r   c                sn    V P                   pVe   VP                  4        V P                  '       d   R# R# )NFT)rb   rn   r_   )r3   r   r?   r   eof_receivedZ!StreamReaderProtocol.eof_received  s.    $$OO>>> r   c                    V P                   # r   )r`   rK   r4   r   rL   Z&StreamReaderProtocol._get_close_waiter&  s    ||r   c                s     V P                   pVP                  4       '       d+   VP                  4       '       g   VP                  4        R # R # R #   \         d     R # i ; ir   )r`   r;   rh   rg   ZAttributeError)r3   Zclosedr?   r   __del__ZStreamReaderProtocol.__del__)  sR    	#\\F {{}}V%5%5%7%7  " &8}  		s   A AA)
r^   r`   r_   r[   rY   rX   ro   rZ   r\   r]   NN)rM   rN   rO   rP   rY   r5   propertyrb   re   rm   rF   rr   rs   rL   ru   rQ   rR   Z__classcell__)ra   rT   s   @@r   r   r      sP      2& ( (
L
%'N$#
		# 	#r   c                   s   a  ] tR tRt o R tR t]R 4       tR tR t	R t
R tR	 tR
 tR tRR ltR tRRRRRR/R lt]3R ltRtV tR# )r   i5  c                s    Wn         W n        W0n        W@n        V P                  P	                  4       V n        V P
                  P                  R 4       R # r   )r]   	_protocol_readerr.   rG   _complete_futr<   )r3   r   r   r   r   s   &&&&&r   r5   ZStreamWriter.__init__?  sA    #! 
!ZZ557%%d+r   c                s    V P                   P                  R V P                  : 2.pV P                  e    VP	                  RV P                  : 24       RP                  RP                  V4      4      # )
transport=zreader=<{}> )ra   rM   r]   ry   rH   formatjoinr3   Zinfor?   r   __repr__ZStreamWriter.__repr__I  s[    '':doo5H)IJ<<#KK'$,,!123}}SXXd^,,r   c                rt   r   r]   r8   r9   r   r   ZStreamWriter.transportO  s    r   c                <    V P                   P                  V4       R # r   )r]   writer3   rq   r4   r   r   ZStreamWriter.writeS  s    d#r   c                r   r   )r]   
writelinesr   r4   r   r   ZStreamWriter.writelinesV  s    ""4(r   c                6    V P                   P                  4       # r   )r]   	write_eofr8   r9   r   r   ZStreamWriter.write_eofY  s    ((**r   c                r   r   )r]   can_write_eofr8   r9   r   r   ZStreamWriter.can_write_eof\  s    ,,..r   c                r   r   )r]   ri   r8   r9   r   ri   ZStreamWriter.close_  s    $$&&r   c                r   r   )r]   
is_closingr8   r9   r   r   ZStreamWriter.is_closingb  s    ))++r   c                sX   "   V P                   P                  V 4      G R j  xL
  R #  L5ir   )rx   rL   r8   r9   r   wait_closedZStreamWriter.wait_closede  s     nn..t444s   *(*Nc                s8    V P                   P                  W4      # r   )r]   rd   )r3   ZnameZdefault   &&&r   rd   ZStreamWriter.get_extra_infoh  s    --d<<r   c                s  "   V P                   e!   V P                   P                  4       pVe   VhV P                  P                  4       '       d   \	        ^ 4      G R j  xL
  V P
                  P                  4       G R j  xL
  R #  L( L5ir   )ry   rg   r]   r   r	   rx   rI   )r3   rD   r?   r   drainZStreamWriter.draink  sk      <<#,,((*C	??%%'' (NNnn**,,, ,s*   ABBB !BB
B
Bserver_hostnamessl_handshake_timeoutssl_shutdown_timeoutc          
     s   "   V P                   P                  R JpV P                   pV P                  4       G R j  xL
  V P                  P	                  V P
                  WaWRVVR7      G R j  xL
 pWpn        VP                  V4       R #  LO L5i)N)server_sider   r   r   )rx   r^   r   r.   	start_tlsr]   re   )r3   rc   r   r   r   r   r   Znew_transports   &&$$$   r   r   ZStreamWriter.start_tls  s     
 nn99E>>jjl"jj22OOX#"7!5	 3 7 7
 (##M2 	7s!   8BB
1B,B-BBc                s   V P                   P                  4       '       gg   V P                  P                  4       '       d   VP                  ! R \
        4       R# V P                  4        VP                  ! RV : 2\
        4       R# R# )zloop is closedz	unclosed N)r]   r   r.   Z	is_closedZwarnZResourceWarningri   )r3   warningsr4   r   ru   ZStreamWriter.__del__  sZ    ))++zz##%%.@

	$2OD ,r   )rz   r.   rx   ry   r]   r   )rM   rN   rO   rP   r5   r   rw   r   r   r   r   r   ri   r   r   rd   r   r   r   ru   rQ   rR   rS   rU   r   r   r   5  s     ,-  $)+/',5=-23(,3.23 .23   ( E Er   c                   s   a  ] tR tRt o Rt]R3R ltR tR tR t	R t
R tR	 tR
 tR tR tR tR tRR ltRR ltR tR tR tRtV tR# )r    i  Nc                s   V^ 8:  d   \        R4      hWn        Vf   \        P                  ! 4       V n        MW n        \        4       V n        RV n        RV n        RV n	        RV n
        RV n        V P                  P                  4       '       d2   \        P                  ! \        P                   ! ^4      4      V n        R# R# )    zLimit cannot be <= 0NF)
ValueError_limitr   r-   r.   Z	bytearray_buffer_eof_waiter
_exceptionr]   r/   r6   r   Zextract_stacksysZ	_getframerY   )r3   r
   r   r   r   r5   ZStreamReader.__init__  s     A:344<..0DJJ {	::!!%3%A%Aa &"D" "r   c                s   R .pV P                   '       d(   VP                  \        V P                   4       R24       V P                  '       d   VP                  R4       V P                  \
        8w  d   VP                  RV P                   24       V P                  '       d    VP                  RV P                  : 24       V P                  '       d    VP                  RV P                  : 24       V P                  '       d    VP                  RV P                  : 24       V P                  '       d   VP                  R4       RP                  R	P                  V4      4      # )
r    z bytesZeofzlimit=zwaiter=z
exception=r{   Zpausedr|   r}   )r   rH   lenr   r   _DEFAULT_LIMITr   r   r]   r/   r~   r   r   r?   r   r   ZStreamReader.__repr__  s    <<<KK3t||,-V45999KK;;.(KK&./<<<KK'$,,!123???KK*T__$789???KK*T__$789<<<KK!}}SXXd^,,r   c                rt   r   )r   r8   r9   r   rg   ZStreamReader.exception  s    r   c                s    Wn         V P                  pVe3   R V n        VP                  4       '       g   VP                  V4       R # R # R # r   )r   r   rh   rB   rC   rE   r   rB   ZStreamReader.set_exception  sD    DL##%%$$S) & r   c                s    V P                   pVe3   R V n         VP                  4       '       g   VP                  R 4       R # R # R # r   )r   rh   r<   r=   r?   r   _wakeup_waiterZStreamReader._wakeup_waiter  s?    DL##%%!!$' & r   c                s    Wn         R # r   r   )r3   r   r4   r   rl   ZStreamReader.set_transport  s    #r   c                s    V P                   '       dJ   \        V P                  4      V P                  8:  d$   R V n         V P                  P                  4        R# R# R# )FN)r/   r   r   r   r]   resume_readingr8   r9   r   _maybe_resume_transportZ$StreamReader._maybe_resume_transport  s=    <<<C-< DLOO**, =<r   c                s4    R V n         V P                  4        R# rA   )r   r   r8   r9   r   rn   ZStreamReader.feed_eof  s    	r   c                sL    V P                   ;'       d    V P                  '       * # r   )r   r   r8   r9   r   at_eofZStreamReader.at_eof  s    yy----r   c                s   V'       g   R # V P                   P                  V4       V P                  4        V P                  ef   V P                  '       gR   \        V P                   4      ^V P                  ,          8  d%    V P                  P                  4        RV n        R # R # R # R #   \         d    R T n         R # i ; i)NT)	r   Zextendr   r]   r/   r   r   Zpause_readingrJ   r   r4   r   rp   ZStreamReader.feed_data  s     D!OO'LLLDLL!AO3$--/  $ 4 ! (
 ' ' #'	's   B+ +C Cc                s>  "   V P                   e   \        V R24      hV P                  '       d"   RV n        V P                  P	                  4        V P
                  P                  4       V n          V P                   G R j  xL
  R V n         R #  L  R T n         i ; i5i)NzF() called while another coroutine is already waiting for incoming dataF)r   ZRuntimeErrorr/   r]   r   r.   rG   )r3   Z	func_namer4   r   _wait_for_dataZStreamReader._wait_for_data  s      <<#+ 4 56 6 <<< DLOO**,zz//1	 ,,DL DLs5   .BA B2B BB 	BB 	BBc                s  "   R p\        V4      p V P                  V4      G Rj  xL
 pV#  L  \        P                   d   pTP                  u Rp?# Rp?i\        P
                   d   pT P                  P                  YP                  4      '       d"   T P                  RTP                  T,           1 MT P                  P                  4        T P                  4        \        TP                  ^ ,          4      hRp?ii ; i5i)   
N)r   	readuntilr   IncompleteReadErrorZpartialLimitOverrunErrorr   Z
startswithZconsumedclearr   r   Zargs)r3   sepZseplenZlineZes   &    r   readlineZStreamReader.readline  s       S
	(,,D  --- 	99++ 	(||&&sJJ77LL!5!**v"5!56""$((*QVVAY''	(sP   D. ,. D. DADDD+D,BC>>DDc                sN  "   \        V\        4      '       d   \        V\        R 7      pMV.pV'       g   \	        R4      h\        V^ ,          4      p\        VR,          4      pV^ 8X  d   \	        R4      hV P
                  e   V P
                  h^ p \        V P                  4      pWT,
          V8  d   RpRpV FI  pV P                  P                  W4      p	V	R8w  g   K'  V	\        V4      ,           p
Ve	   W8  g   KE  T
pT	pKK  	  Ve   M\        ^ V^,           V,
          4      pW@P                  8  d   \        P                  ! RV4      hV P                  '       dG   \        V P                  4      pV P                  P                  4        \        P                  ! VR4      hV P!                  R4      G Rj  xL
  EK0  W`P                  8  d   \        P                  ! RV4      hV P                  RV pV P                  RV1 V P#                  4        \        V4      #  Lg5i))Zkeyz-Separator should contain at least one elementz,Separator should be at least one-byte stringNz2Separator is not found, and chunk exceed the limitr   z2Separator is found, but chunk is longer than limit)Z
isinstanceZtupleZsortedr   r   r   r   ZfindZmaxr   r   r   r   bytesr   r   r   r   )r3   Z	separatorZ
min_seplenZ
max_seplenZoffsetZbuflenZmatch_startZ	match_endr   ZisepZendZchunks   &&          r   r   ZStreamReader.readuntil>  s    4 i''yc2I"ILMM1&
2'
?KLL??&//!*  &F *," 	$C<<,,S9Drz #SXo$,(+I*.K % ( Q
Z 78KK'$66L    yyydll+""$ 44UDAA %%k222$..DkS S Zi(LL)$$$&U| 3s,   3H%B(H%#H%AH%!AH%;H#<A(H%c                s
  "   V P                   e   V P                   hV^ 8X  d   R# V^ 8  dT   . p V P                  V P                  4      G R j  xL
 pV'       g   MVP                  V4       K@  RP	                  V4      # V P
                  '       g,   V P                  '       g   V P                  R4      G R j  xL
  \        \        V P
                  4      R V 4      pV P
                  R V1 V P                  4        V#  L LH5i)Nr   read)r   r   r   rH   r   r   r   r   r   
memoryviewr   )r3   nZblocksZblockrq   s   &&   r   r   ZStreamReader.read  s     , ??&//!6q5
 F"ii44e$88F##|||DIII%%f--- Z-bq12LL!$$& 5 .s7   ADC?D6DD$D8D9ADDc                s  "   V^ 8  d   \        R4      hV P                  e   V P                  hV^ 8X  d   R# \        V P                  4      V8  ds   V P                  '       dF   \        V P                  4      pV P                  P                  4        \        P                  ! W!4      hV P                  R4      G Rj  xL
  K  \        V P                  4      V8X  d1   \        V P                  4      pV P                  P                  4        M0\        \        V P                  4      RV 4      pV P                  RV1 V P                  4        V#  L5i)r   z*readexactly size can not be less than zeroNr   readexactly)r   r   r   r   r   r   r   r   r   r   r   r   )r3   r   Z
incompleterq   s   &&  r   r   ZStreamReader.readexactly  s     q5IJJ??&//!6$,,!#yyy"4<<0
""$ 44ZCC%%m444t||!&DLL DLL1"156DRaR $$& 5s   A!E$AE=E>BEc                s    V # r   r   r8   r9   r   	__aiter__ZStreamReader.__aiter__  s    r   c                s\   "   V P                  4       G R j  xL
 pVR8X  d   \        hV#  L5i)Nr   )r   ZStopAsyncIteration)r3   Zvalr?   r   	__anext__ZStreamReader.__anext__  s*     MMO##:$$
 $s   ,*,)	r   r   r   r   r.   r/   rY   r]   r   )r   )r   )rM   rN   rO   rP   rY   r   r5   r   rg   rB   r   rl   r   rn   r   rp   r   r   r   r   r   r   r   rQ   rR   rS   rU   r   r    r      sn     +$ ",-$*($-
.$, 8>pd1f'R r   )r    r   r   r   r(   )r*   r+   i   rv   r   )Z__all__r0   Zsocketr   r   rW   ZhasattrZ r   r   r   r   r   Zlogr   Ztasksr	   r   r   r(   r*   r+   ZProtocolr,   r   r   r    r   r   r   <module>r      s   '   
  
69<<G         .8A+AB 69
)7
D&4D="y)) ="@~#+Y-?-? ~#BeE eENw wr   