GIF89a=( õ' 7IAXKgNgYvYx\%wh…hŽth%ˆs%—x¨}9®Œ©€&©‰%¶†(¹–.¹5·œD¹&Çš)ÇŸ5ǘ;Í£*È¡&Õ²)ׯ7×µ<Ñ»4ï°3ø‘HÖ§KͯT÷¨Yÿšqÿ»qÿÔFØ !ù ' !ÿ NETSCAPE2.0 , =( þÀ“pH,È¤rÉl:ŸÐ¨tJ­Z¯Ø¬vËíz¿à°xL.›Ïè´zÍn»ßð¸|N¯Ûïø¼~Ïïûÿ€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§gª«ªE¯°¨¬ª±²Œ¹º¹E¾­”´ÂB¶¯ §Åȸ»ÑD¾¿Á•ÄÅ®° ÝH¾ÒLÀÆDÙ«D¶BÝïðÀ¾DÑÑÔTÌÍíH òGö¨A RÎڐ |¥ ٭&ºìE8œ¹kGÔAÞpx­a¶­ã R2XB®åE8I€Õ6Xî:vT)äžþÀq¦è³¥ì仕F~%xñ  4#ZÔ‰O|-4Bs‘X:= QÉ œš lºÒyXJŠGȦ|s hÏíK–3l7·B|¥$'7Jީܪ‰‡àá”Dæn=Pƒ ¤Òëí‰`䌨ljóá¯Éüv>á–Á¼5 ½.69ûϸd«­ºÀûnlv©‹ªîf{¬ÜãPbŸ  l5‘ޝpß ´ ˜3aÅùäI«O’ý·‘áÞ‡˜¾Æ‚ÙÏiÇÿ‹Àƒ #öó)pâš Þ½ ‘Ý{ó)vmÞü%D~ 6f s}ŃƒDØW Eþ`‡þ À…L8xá†ç˜{)x`X/> Ì}mø‚–RØ‘*|`D=‚Ø_ ^ð5 !_…'aä“OÚ—7âcð`D”Cx`ÝÂ¥ä‹éY¹—F¼¤¥Š?¡Õ™ n@`} lď’ÄÉ@4>ñd œ à‘vÒxNÃ×™@žd=ˆgsžG±æ ´²æud &p8Qñ)ˆ«lXD©øÜéAžHìySun jª×k*D¤LH] †¦§C™Jä–´Xb~ʪwStŽ6K,°£qÁœ:9ت:¨þªl¨@¡`‚ûÚ ».Û¬¯t‹ÆSÉ[:°=Š‹„‘Nåû”Ìî{¿ÂA ‡Rà›ÀÙ6úë°Ÿð0Ä_ ½;ÃϱîÉì^ÇÛÇ#Ëë¼ôº!±Ä˜íUîÅÇ;0L1óÁµö«p% AÀºU̬ݵ¼á%霼€‡¯Á~`ÏG¯»À× ­²± =4ªnpð3¾¤³¯­ü¾¦îuÙuµÙ®|%2ÊIÿür¦#0·ÔJ``8È@S@5ê¢ ö×Þ^`8EÜ]ý.뜃Âç 7 ú ȉÞj œ½Dç zý¸iþœÑÙûÄë!ˆÞÀl§Ïw‹*DçI€nEX¯¬¼ &A¬Go¼QföõFç°¯;é¦÷îŽêJ°îúôF5¡ÌQ|îúöXªæ»TÁÏyñêï]ê² o óÎC=öõ›ÒÓPB@ D×½œä(>èCÂxŽ`±«Ÿ–JЀ»Û á¤±p+eE0`ëŽ`A Ú/NE€Ø†À9‚@¤à H½7”à‡%B‰`Àl*ƒó‘–‡8 2ñ%¸ —€:Ù1Á‰E¸àux%nP1ð!‘ðC)¾P81lÑɸF#ˆ€{´âé°ÈB„0>±û °b¡Š´±O‚3È–Ù()yRpbµ¨E.Z‘D8ÊH@% òŒx+%Ù˜Æcü »¸˜fõ¬b·d`Fê™8èXH"ÉÈ-±|1Ô6iI, 2““¬$+](A*jÐ QTÂo‰.ÛU슬Œã„Ž`¯SN¡–¶Äåyše¯ª’­¬‚´b¦Éož œ)åyâ@Ì®3 ÎtT̉°&Ø+žLÀf"Ø-|žçÔ>‡Ðv¦Ðžì\‚ Q1)Ž@Žh#aP72”ˆ™¨$‚ !ù " , =( …7IAXG]KgNgYvYxR"k\%w]'}hŽth%ˆg+ˆs%—r.—m3šx3˜x¨}9®€&©€+¨‡7§‰%¶†(¹–.¹œD¹&ǘ;Í•&ײ)×»4ïÌ6ò§KÍ þ@‘pH,È¤rÉl:ŸÐ¨tJ­Z¯Ø¬vËíz¿à°xL.›Ïè´zÍn»ßð¸|N¯Ûïø¼~Ïïûÿ€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§g «¬ E ±± ¨­¶°ººE Á´”·®C¬²§Ç¶Œ»ÓDÃÕƷ¯Ê±H½ºM×ÁGÚ¬D¶BËÁ½î½DÓôTÏÛßîG»ôõC×CÌ l&âž:'òtU³6ɹ#·Ø)€'Ü.6±&ëÍÈ» K(8p0N?!æ2"ÛˆNIJX>R¼ÐO‚M '¡¨2¸*Ÿþ>#n↠å@‚<[:¡Iïf’ ¤TÚ˘CdbÜÙ“[«ŽEú5MBo¤×@€`@„€Êt W-3 ¶Ÿ¡BíêäjIÝ…Eò9[T…$íêﯧ„…•s»Óȳ¹€ÅÚdc®UUρ#±Ùïldj?´í¼²`\ŽÁðÞu|3'ÖŒ]ë6 ¶S#²‡˜FKLÈ *N E´‘áäŠ$˜›eÄYD„ºq«.è촁ƒs \-ÔjA 9²õ÷å- üúM[Âx(ís÷ì®x€|í¡Ù’p¦‚ ŽkÛTÇDpE@WÜ ²Ç]kŠ1¨ þ€·Yb ÓÁ‰l°*n0 ç™—žzBdОu¾7ĉBl€â‰-ºx~|UåU‰  h*Hœ|e"#"?vpÄiŠe6^ˆ„+qâŠm8 #VÇá ‘å–ÄV„œ|Аè•m"сœn|@›U¶ÆÎž—Špb¥G¨ED”€±Úê2FÌIç? >Éxå Œ± ¡¤„%‘žjŸ‘ꄯ<Ìaà9ijÐ2˜D¦È&›†Z`‚å]wþ¼Â:ç6àB¤7eFJ|õÒ§Õ,¨äàFÇ®cS·Ê¶+B°,‘Þ˜ºNûãØ>PADÌHD¹æž«ÄÀnÌ¥}­#Ë’ë QÀÉSÌÂÇ2ÌXÀ{æk²lQÁ2«ÊðÀ¯w|2Í h‹ÄÂG€,m¾¶ë3ÐÙ6-´ÅE¬L°ÆIij*K½ÀÇqï`DwVÍQXœÚÔpeœ±¬Ñ q˜§Tœ½µƒ°Œìu Â<¶aØ*At¯lmEØ ü ôÛN[P1ÔÛ¦­±$ÜÆ@`ùåDpy¶yXvCAyåB`ŽD¶ 0QwG#¯ æš[^Äþ $ÀÓÝǦ{„L™[±úKÄgÌ;ï£S~¹ìGX.ôgoT.»åˆ°ùŸûù¡?1zö¦Ÿž:ÅgÁ|ìL¹ „®£œŠ‚à0œ]PÁ^p F<"•ç?!,ñ‡N4—…PÄ Á„ö¨Û:Tè@hÀ‹%táÿ:ø-žI<`þ‹p I….)^ 40D#p@ƒj4–؀:²‰1Øâr˜¼F2oW¼#Z†;$Q q” ‘ ÂK¦ñNl#29 !’F@¥Bh·ᏀL!—XFóLH‘Kh¤.«hE&JòG¨¥<™WN!€ÑÙÚˆY„@†>Œž19J" 2,/ &.GXB%ÌRÈ9B6¹W]’î×ÔW¥’IÎ$ ñ‹ÓŒE8YÆ ¼³™ñA5“à®Q.aŸB€&Ø©³ JÁ—! ¦t)K%tœ-¦JF bòNMxLôþ)ÐR¸Ð™‘ èÝ6‘O!THÌ„HÛ ‰ !ù ) , =( …AXKgNgYvYxR"k\%wh…hŽh%ˆg+ˆs%—r.—x3˜x¨}9®€&©€+¨Œ,©‡7§‰%¶†(¹–.¹5·&Çš)ǘ;Í•&×£*Ȳ)ׯ7×»4ï°3øÌ6ò‘HÖ§KÍ»Hó¯T÷¨Yÿ»qÿÇhÿ þÀ”pH,È¤rÉl:ŸÐ¨tJ­Z¯Ø¬vËíz¿à°xL.›Ïè´zÍn»ßð¸|N¯Ûïø¼~Ïïûÿ€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§g ª« E$±²¨ª­ · °²½$E$ÂÕ««D· Í ¿¦Ç¶¸ÌŒ¾³CÃÅÆ E ééH½MÛÂGâªD­ çBêêϾD²ÒaÀà€Š1r­ðÓ¤ ÔožzU!L˜C'¾yW½UGtäÇïÙllê0×àÂuGþ)AÀs[þ·xì ÁxO%ƒûX2ó—  P£n›R/¡ÑšHše+êDm?# —‘Ç£6¡8íJ¡ŸâDiäªM¥Ö„ôj“¬¹£5oQ7°- <‡ *´lãÓŒ2r/a!l)dÈ A™ÈE¢ôÔ͆…ð ;Ö˜c ¡%ß‚’Ùˆâ¸b½—pe~C"BíëÚHïeF2§æŠ8qb t_`urŠeü wÅu3êæPv§h•"ß`íÍxçLĹÜÖ3á  ~Öº“®›¸ÏMDfJÙ °„ÛµáWõ%§œ‚à©–‚X ÓØ)@®Ñ›Eþ´wëuÅSxb8y\mÖzœ¥§ZbºE—ÂLªÌw!y(>¡™wú=Ç|ÅÝs¢d €CÁW)HÜcC$€L Ä7„r.á\{)@ð` @ äXÈ$PD” `šaG:§æˆOˆ72EÐamn]ù"ŒcÊxÑŒ° &dR8`g«iÙŸLR!¦P …d’ä¡“¦ðÎTƒ¦ià|À _ ¥ Qi#¦Šg›Æ ›noMµ ›V ã£)p ç£ÎW…š=Âeªk§†j„ ´®1ß²sÉxéW«jšl|0¯B0Û, \jÛ´›6±¬¶C ÛíWþï|ëÙ‹¸ñzĸV {ì;Ýñn¼òVˆm³I¼³.Ðã¤PN¥ ²µ¼„µCã+¹ÍByî£Ñ¾HŸ›ëê 7ìYÆFTk¨SaoaY$Dµœìï¿Ã29RÈkt Çïfñ ÇÒ:ÀÐSp¹3ÇI¨â¥DZÄ ü9Ïýögñ½­uÔ*3)O‘˜Ö[_hv ,àî×Et Ÿé¶BH€ Õ[ü±64M@ÔSÌM7dÐl5-ÄÙU܍´©zߌ3Ô€3ž„ „ ¶ÛPô½5×g› êÚ˜kN„Ý…0Îj4€Ìë°“#{þÕ3S2çKÜ'ợlø¼Ú2K{° {Û¶?žm𸧠ËI¼nEò='êüóºè^üæÃ_Û=°óž‚ì#Oý¿Í'¡½áo..ÏYìnüñCœO±Áa¿¢Kô½o,üÄËbö²çºíï{ËC Ú— "”Ï{ËK ÍÒw„õ±Oz dÕ¨à:$ ƒô—«v»] A#ð «€¿šéz)Rx׿ˆ¥‚d``èw-îyÏf×K!ð€þ­Ð|ìPľ„=Ì`ý(f” 'Pa ¥ÐBJa%Ðâf§„%Š¡}FàáÝ×6>ÉäŠG"éŽè=ø!oа^FP¼Ø©Q„ÀCÙÁ`(Ž\ÄÝ® ©Â$<n@dÄ E#ììUÒI! ‚#lù‹`k¦ÐÇ'Rró’ZýNBÈMF Í[¤+‹ðɈ-áwj¨¥þ8¾rá ,VÂh„"|½œ=×G_¦Ñ™EØ 0i*%̲˜Æda0mV‚k¾)›;„&6 p>ÓjK “¦Ç# âDÂ:ûc?:R Ó¬fÞéI-Ì“•Ã<ä=™Ï7˜3œ¨˜c2ŒW ,ˆ”8(T™P‰F¡Jhç"‚ ; 403WebShell
403Webshell
Server IP : 172.67.177.218  /  Your IP : 216.73.216.243
Web Server : LiteSpeed
System : Linux premium229.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
User : akhalid ( 749)
PHP Version : 8.3.22
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/lib64/python3.6/asyncio/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib64/python3.6/asyncio/__pycache__/unix_events.cpython-36.pyc
3


 \���
@s dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddl
mZddl
m
Z
ddl
mZddl
mZdd	l
mZdd
l
mZddl
mZddl
mZdd
l
mZddlmZddlmZdddddgZejdkr�ed��dd�Zy
ejZWnek
�r,dd�ZYnXGdd�dej�Z e!ed��rVdd�Z"nddl#Z#d d�Z"Gd!d"�d"ej$�Z%Gd#d$�d$ej&ej'�Z(e!ed%��r�ej)Z*nddl#Z#d&d'�Z*Gd(d)�d)ej+�Z,Gd*d�d�Z-Gd+d,�d,e-�Z.Gd-d�de.�Z/Gd.d�de.�Z0Gd/d0�d0ej1�Z2e Z3e2Z4dS)1z2Selector event loop for Unix with signal handling.�N�)�base_events)�base_subprocess)�compat)�	constants)�
coroutines)�events)�futures)�selector_events)�	selectors)�
transports)�	coroutine)�logger�SelectorEventLoop�AbstractChildWatcher�SafeChildWatcher�FastChildWatcher�DefaultEventLoopPolicyZwin32z+Signals are not really supported on WindowscCsdS)zDummy signal handler.N�)�signum�framerr�+/usr/lib64/python3.6/asyncio/unix_events.py�_sighandler_noop%srcCs|S)Nr)�pathrrr�<lambda>.srcs�eZdZdZd"�fdd�	Zdd�Z�fdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zd#dd�Zd$dd�Z
ed%dd��Zdd�Zedddd�dd��Zed&dddd�d d!��Z�ZS)'�_UnixSelectorEventLoopzdUnix event loop.

    Adds signal handling and UNIX Domain Socket support to SelectorEventLoop.
    Ncst�j|�i|_dS)N)�super�__init__�_signal_handlers)�self�selector)�	__class__rrr7sz_UnixSelectorEventLoop.__init__cCstj�S)N)�socketZ
socketpair)rrrr�_socketpair;sz"_UnixSelectorEventLoop._socketpaircs^t�j�tj�s2xFt|j�D]}|j|�qWn(|jrZtjd|�d�t	|d�|jj
�dS)NzClosing the loop z@ on interpreter shutdown stage, skipping signal handlers removal)�source)r�close�sys�
is_finalizing�listr�remove_signal_handler�warnings�warn�ResourceWarning�clear)r�sig)r!rrr%>s
z_UnixSelectorEventLoop.closecCs"x|D]}|sq|j|�qWdS)N)�_handle_signal)r�datarrrr�_process_self_dataLs
z)_UnixSelectorEventLoop._process_self_datac+GsHtj|�stj|�rtd��|j|�|j�ytj|jj	��Wn2t
tfk
rt}ztt
|���WYdd}~XnXtj|||�}||j|<ytj|t�tj|d�Wn�tk
�rB}zz|j|=|j�sytjd�Wn4t
tfk
�r}ztjd|�WYdd}~XnX|jtjk�r0tdj|���n�WYdd}~XnXdS)z�Add a handler for a signal.  UNIX only.

        Raise ValueError if the signal number is invalid or uncatchable.
        Raise RuntimeError if there is a problem setting up the handler.
        z3coroutines cannot be used with add_signal_handler()NFrzset_wakeup_fd(-1) failed: %szsig {} cannot be caught���)rZiscoroutineZiscoroutinefunction�	TypeError�
_check_signalZ
_check_closed�signal�
set_wakeup_fdZ_csock�fileno�
ValueError�OSError�RuntimeError�strrZHandlerr�siginterruptr�info�errno�EINVAL�format)rr.�callback�args�exc�handleZnexcrrr�add_signal_handlerSs0



z)_UnixSelectorEventLoop.add_signal_handlercCs8|jj|�}|dkrdS|jr*|j|�n
|j|�dS)z2Internal helper that is the actual signal handler.N)r�getZ
_cancelledr)Z_add_callback_signalsafe)rr.rDrrrr/�sz%_UnixSelectorEventLoop._handle_signalc&Cs�|j|�y|j|=Wntk
r*dSX|tjkr>tj}ntj}ytj||�Wn@tk
r�}z$|jtj	kr�t
dj|���n�WYdd}~XnX|js�ytjd�Wn2t
tfk
r�}ztjd|�WYdd}~XnXdS)zwRemove a handler for a signal.  UNIX only.

        Return True if a signal handler was removed, False if not.
        Fzsig {} cannot be caughtNrzset_wakeup_fd(-1) failed: %sTr2)r4r�KeyErrorr5�SIGINT�default_int_handler�SIG_DFLr9r>r?r:r@r6r8rr=)rr.ZhandlerrCrrrr)�s(

z,_UnixSelectorEventLoop.remove_signal_handlercCsHt|t�stdj|���d|ko,tjknsDtdj|tj���dS)z�Internal helper to validate a signal.

        Raise ValueError if the signal number is invalid or uncatchable.
        Raise RuntimeError if there is a problem setting up the handler.
        zsig must be an int, not {!r}rzsig {} out of range(1, {})N)�
isinstance�intr3r@r5�NSIGr8)rr.rrrr4�s

z$_UnixSelectorEventLoop._check_signalcCst|||||�S)N)�_UnixReadPipeTransport)r�pipe�protocol�waiter�extrarrr�_make_read_pipe_transport�sz0_UnixSelectorEventLoop._make_read_pipe_transportcCst|||||�S)N)�_UnixWritePipeTransport)rrOrPrQrRrrr�_make_write_pipe_transport�sz1_UnixSelectorEventLoop._make_write_pipe_transportc	ks�tj���}
|j�}t||||||||f||d�|	��}|
j|j�|j|�y|EdHWn&tk
r~}
z
|
}WYdd}
~
XnXd}|dk	r�|j�|j	�EdH|�WdQRX|S)N)rQrR)
r�get_child_watcherZ
create_future�_UnixSubprocessTransport�add_child_handlerZget_pid�_child_watcher_callback�	Exceptionr%Z_wait)rrPrB�shell�stdin�stdout�stderr�bufsizerR�kwargs�watcherrQ�transprC�errrrr�_make_subprocess_transport�s$




z1_UnixSelectorEventLoop._make_subprocess_transportcCs|j|j|�dS)N)Zcall_soon_threadsafeZ_process_exited)r�pid�
returncoderbrrrrY�sz._UnixSelectorEventLoop._child_watcher_callback)�ssl�sock�server_hostnameccs|dkst|t�st�|r,|dkr<td��n|dk	r<td��|dk	r�|dk	rTtd��tjtjtjd�}y |jd�|j||�EdHWq�|j	��Yq�XnB|dkr�td��|j
tjks�tj|j
�r�tdj|���|jd�|j||||�EdH\}}||fS)Nz/you have to pass server_hostname when using sslz+server_hostname is only meaningful with sslz3path and sock can not be specified at the same timerFzno path and sock were specifiedz2A UNIX Domain Stream Socket was expected, got {!r})rKr;�AssertionErrorr8r"�AF_UNIX�SOCK_STREAM�setblockingZsock_connectr%�familyr�_is_stream_socket�typer@Z_create_connection_transport)r�protocol_factoryrrgrhri�	transportrPrrr�create_unix_connection�s:


z-_UnixSelectorEventLoop.create_unix_connection�d)rh�backlogrgc
!Cs�t|t�rtd��|dk	�r0|dk	r,td��t|�}tjtjtj�}|dd
kr�y tj	t
j|�j�rnt
j|�WnBt
k
r�Yn0tk
r�}ztjd||�WYdd}~XnXy|j|�Wnjtk
�r}z8|j�|jtjk�rdj|�}ttj|�d�n�WYdd}~Xn|j��YnXn>|dk�rBtd��|jtjk�s`tj|j��rntdj|���tj||g�}	|j|�|jd	�|j||||	�|	S)Nz*ssl argument must be an SSLContext or Nonez3path and sock can not be specified at the same timer�z2Unable to check or remove stale UNIX socket %r: %rzAddress {!r} is already in usez-path was not specified, and no sock specifiedz2A UNIX Domain Stream Socket was expected, got {!r}F)rrv)rK�boolr3r8�_fspathr"rkrl�stat�S_ISSOCK�os�st_mode�remove�FileNotFoundErrorr9r�errorZbindr%r>Z
EADDRINUSEr@rnrrorpZServerZlistenrmZ_start_serving)
rrqrrhrurgrcrC�msgZserverrrr�create_unix_serversP

 




z)_UnixSelectorEventLoop.create_unix_server)N)NN)NN)N)N)�__name__�
__module__�__qualname__�__doc__rr#r%r1rEr/r)r4rSrUr
rdrYrsr��
__classcell__rr)r!rr1s,-
 


%r�set_blockingcCstj|d�dS)NF)r{r�)�fdrrr�_set_nonblockingBsr�cCs,tj|tj�}|tjB}tj|tj|�dS)N)�fcntlZF_GETFLr{�
O_NONBLOCKZF_SETFL)r��flagsrrrr�Gs
cs�eZdZdZd �fdd�	Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Ze
jrhdd�Zd!dd�Zdd�Zdd�Z�ZS)"rN�iNcs�t�j|�||jd<||_||_|j�|_||_d|_t	j
|j�j}tj
|�pbtj|�pbtj|�s~d|_d|_d|_td��t|j�|jj|jj|�|jj|jj|j|j�|dk	r�|jjtj|d�dS)NrOFz)Pipe transport is for pipes/sockets only.)rr�_extra�_loop�_piper7�_fileno�	_protocol�_closingr{�fstatr|ry�S_ISFIFOrz�S_ISCHRr8r��	call_soon�connection_made�_add_reader�_read_readyr	�_set_result_unless_cancelled)r�looprOrPrQrR�mode)r!rrrQs,






z_UnixReadPipeTransport.__init__cCs�|jjg}|jdkr |jd�n|jr0|jd�|jd|j�t|jdd�}|jdk	r�|dk	r�tj	||jt
j�}|r�|jd�q�|jd�n |jdk	r�|jd�n
|jd�dd	j|�S)
N�closed�closingzfd=%s�	_selector�polling�idle�openz<%s>� )
r!r�r��appendr�r��getattrr�r
�_test_selector_eventrZ
EVENT_READ�join)rr=r r�rrr�__repr__ns$




z_UnixReadPipeTransport.__repr__cCs�ytj|j|j�}WnDttfk
r,Yn�tk
rX}z|j|d�WYdd}~Xn^X|rl|jj	|�nJ|j
j�r�tj
d|�d|_|j
j|j�|j
j|jj�|j
j|jd�dS)Nz"Fatal read error on pipe transportz%r was closed by peerT)r{�readr��max_size�BlockingIOError�InterruptedErrorr9�_fatal_errorr�Z
data_receivedr��	get_debugrr=r��_remove_readerr�Zeof_received�_call_connection_lost)rr0rCrrrr��s
z"_UnixReadPipeTransport._read_readycCs|jj|j�dS)N)r�r�r�)rrrr�
pause_reading�sz$_UnixReadPipeTransport.pause_readingcCs|jj|j|j�dS)N)r�r�r�r�)rrrr�resume_reading�sz%_UnixReadPipeTransport.resume_readingcCs
||_dS)N)r�)rrPrrr�set_protocol�sz#_UnixReadPipeTransport.set_protocolcCs|jS)N)r�)rrrr�get_protocol�sz#_UnixReadPipeTransport.get_protocolcCs|jS)N)r�)rrrr�
is_closing�sz!_UnixReadPipeTransport.is_closingcCs|js|jd�dS)N)r��_close)rrrrr%�sz_UnixReadPipeTransport.closecCs,|jdk	r(tjd|t|d�|jj�dS)Nzunclosed transport %r)r$)r�r*r+r,r%)rrrr�__del__�s
z_UnixReadPipeTransport.__del__�Fatal error on pipe transportcCsZt|t�r4|jtjkr4|jj�rLtjd||dd�n|jj||||j	d��|j
|�dS)Nz%r: %sT)�exc_info)�message�	exceptionrrrP)rKr9r>ZEIOr�r�r�debug�call_exception_handlerr�r�)rrCr�rrrr��s
z#_UnixReadPipeTransport._fatal_errorcCs(d|_|jj|j�|jj|j|�dS)NT)r�r�r�r�r�r�)rrCrrrr��sz_UnixReadPipeTransport._closecCs4z|jj|�Wd|jj�d|_d|_d|_XdS)N)r��connection_lostr�r%r�)rrCrrrr��s
z,_UnixReadPipeTransport._call_connection_losti)NN)r�)r�r�r�r�rr�r�r�r�r�r�r�r%r�PY34r�r�r�r�r�rr)r!rrNMs
rNcs�eZdZd%�fdd�	Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zejr|dd�Zdd�Zd&dd �Zd'd!d"�Zd#d$�Z�ZS)(rTNc
s�t�j||�||jd<||_|j�|_||_t�|_d|_	d|_
tj|j�j
}tj|�}tj|�}tj|�}	|px|px|	s�d|_d|_d|_td��t|j�|jj|jj|�|	s�|r�tjjd�r�|jj|jj|j|j�|dk	r�|jjtj|d�dS)NrOrFz?Pipe transport is only for pipes, sockets and character devices�aix)rrr�r�r7r�r��	bytearray�_buffer�
_conn_lostr�r{r�r|ryr�r�rzr8r�r�r�r�r&�platform�
startswithr�r�r	r�)
rr�rOrPrQrRr�Zis_charZis_fifoZ	is_socket)r!rrr�s2






z _UnixWritePipeTransport.__init__cCs�|jjg}|jdkr |jd�n|jr0|jd�|jd|j�t|jdd�}|jdk	r�|dk	r�tj	||jt
j�}|r�|jd�n
|jd�|j�}|jd|�n |jdk	r�|jd�n
|jd�d	d
j
|�S)Nr�r�zfd=%sr�r�r�z
bufsize=%sr�z<%s>r�)r!r�r�r�r�r�r�r�r
r�rZEVENT_WRITE�get_write_buffer_sizer�)rr=r r�r_rrrr��s(





z _UnixWritePipeTransport.__repr__cCs
t|j�S)N)�lenr�)rrrrr�sz-_UnixWritePipeTransport.get_write_buffer_sizecCs6|jj�rtjd|�|jr*|jt��n|j�dS)Nz%r was closed by peer)r�r�rr=r�r��BrokenPipeError)rrrrr�s

z#_UnixWritePipeTransport._read_readycCs0t|tttf�stt|���t|t�r.t|�}|s6dS|jsB|jrj|jtj	krXt
jd�|jd7_dS|j�syt
j|j|�}WnTttfk
r�d}Yn:tk
r�}z|jd7_|j|d�dSd}~XnX|t|�kr�dS|dk�rt|�|d�}|jj|j|j�|j|7_|j�dS)Nz=pipe closed by peer or os.write(pipe, data) raised exception.rrz#Fatal write error on pipe transport)rK�bytesr��
memoryviewrj�reprr�r�rZ!LOG_THRESHOLD_FOR_CONNLOST_WRITESr�warningr�r{�writer�r�r�rZr�r�r�Z_add_writer�_write_readyZ_maybe_pause_protocol)rr0�nrCrrrr�s4


z_UnixWritePipeTransport.writecCs�|jstd��ytj|j|j�}Wnjttfk
r:Yn�tk
r�}z8|jj�|j	d7_	|j
j|j�|j|d�WYdd}~XnfX|t
|j�kr�|jj�|j
j|j�|j�|jr�|j
j|j�|jd�dS|dkr�|jd|�=dS)NzData should not be emptyrz#Fatal write error on pipe transportr)r�rjr{r�r�r�r�rZr-r�r��_remove_writerr�r�Z_maybe_resume_protocolr�r�r�)rr�rCrrrr�>s(


z$_UnixWritePipeTransport._write_readycCsdS)NTr)rrrr�
can_write_eofXsz%_UnixWritePipeTransport.can_write_eofcCsB|jr
dS|jst�d|_|js>|jj|j�|jj|jd�dS)NT)	r�r�rjr�r�r�r�r�r�)rrrr�	write_eof[s
z!_UnixWritePipeTransport.write_eofcCs
||_dS)N)r�)rrPrrrr�dsz$_UnixWritePipeTransport.set_protocolcCs|jS)N)r�)rrrrr�gsz$_UnixWritePipeTransport.get_protocolcCs|jS)N)r�)rrrrr�jsz"_UnixWritePipeTransport.is_closingcCs|jdk	r|jr|j�dS)N)r�r�r�)rrrrr%msz_UnixWritePipeTransport.closecCs,|jdk	r(tjd|t|d�|jj�dS)Nzunclosed transport %r)r$)r�r*r+r,r%)rrrrr�vs
z_UnixWritePipeTransport.__del__cCs|jd�dS)N)r�)rrrr�abort|sz_UnixWritePipeTransport.abort�Fatal error on pipe transportcCsPt|tj�r*|jj�rBtjd||dd�n|jj||||jd��|j	|�dS)Nz%r: %sT)r�)r�r�rrrP)
rKrZ_FATAL_ERROR_IGNOREr�r�rr�r�r�r�)rrCr�rrrr�s
z$_UnixWritePipeTransport._fatal_errorcCsFd|_|jr|jj|j�|jj�|jj|j�|jj|j|�dS)NT)	r�r�r�r�r�r-r�r�r�)rrCrrrr��s
z_UnixWritePipeTransport._closecCs4z|jj|�Wd|jj�d|_d|_d|_XdS)N)r�r�r�r%r�)rrCrrrr��s
z-_UnixWritePipeTransport._call_connection_lost)NN)r�)N)r�r�r�rr�r�r�r�r�r�r�r�r�r�r%rr�r�r�r�r�r�r�rr)r!rrT�s$%	!	

rT�set_inheritablecCsNttdd�}tj|tj�}|s4tj|tj||B�ntj|tj||@�dS)NZ
FD_CLOEXECr)r�r�ZF_GETFDZF_SETFD)r�ZinheritableZcloexec_flag�oldrrr�_set_inheritable�s
r�c@seZdZdd�ZdS)rWc		Ksvd}|tjkr*|jj�\}}t|j�d�tj|f||||d|d�|��|_|dk	rr|j�t	|j
�d|d�|j_dS)NF)r[r\r]r^Zuniversal_newlinesr_�wb)�	buffering)�
subprocess�PIPEr�r#r�r7�Popen�_procr%r��detachr\)	rrBr[r\r]r^r_r`Zstdin_wrrr�_start�s
z_UnixSubprocessTransport._startN)r�r�r�r�rrrrrW�srWc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)raHAbstract base class for monitoring child processes.

    Objects derived from this class monitor a collection of subprocesses and
    report their termination or interruption by a signal.

    New callbacks are registered with .add_child_handler(). Starting a new
    process must be done within a 'with' block to allow the watcher to suspend
    its activity until the new process if fully registered (this is needed to
    prevent a race condition in some implementations).

    Example:
        with watcher:
            proc = subprocess.Popen("sleep 1")
            watcher.add_child_handler(proc.pid, callback)

    Notes:
        Implementations of this class must be thread-safe.

        Since child watcher objects may catch the SIGCHLD signal and call
        waitpid(-1), there should be only one active object per process.
    cGs
t��dS)aRegister a new child handler.

        Arrange for callback(pid, returncode, *args) to be called when
        process 'pid' terminates. Specifying another callback for the same
        process replaces the previous handler.

        Note: callback() must be thread-safe.
        N)�NotImplementedError)rrerArBrrrrX�s	z&AbstractChildWatcher.add_child_handlercCs
t��dS)z�Removes the handler for process 'pid'.

        The function returns True if the handler was successfully removed,
        False if there was nothing to remove.N)r�)rrerrr�remove_child_handler�sz)AbstractChildWatcher.remove_child_handlercCs
t��dS)z�Attach the watcher to an event loop.

        If the watcher was previously attached to an event loop, then it is
        first detached before attaching to the new loop.

        Note: loop may be None.
        N)r�)rr�rrr�attach_loop�sz AbstractChildWatcher.attach_loopcCs
t��dS)zlClose the watcher.

        This must be called to make sure that any underlying resource is freed.
        N)r�)rrrrr%�szAbstractChildWatcher.closecCs
t��dS)zdEnter the watcher's context and allow starting new processes

        This function must return selfN)r�)rrrr�	__enter__szAbstractChildWatcher.__enter__cCs
t��dS)zExit the watcher's contextN)r�)r�a�b�crrr�__exit__	szAbstractChildWatcher.__exit__N)
r�r�r�r�rXr�r�r%r�r�rrrrr�s
c@sDeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dS)�BaseChildWatchercCsd|_i|_dS)N)r��
_callbacks)rrrrrszBaseChildWatcher.__init__cCs|jd�dS)N)r�)rrrrr%szBaseChildWatcher.closecCs
t��dS)N)r�)r�expected_pidrrr�_do_waitpidszBaseChildWatcher._do_waitpidcCs
t��dS)N)r�)rrrr�_do_waitpid_allsz BaseChildWatcher._do_waitpid_allcCs~|dkst|tj�st�|jdk	r<|dkr<|jr<tjdt�|jdk	rT|jj	t
j�||_|dk	rz|jt
j|j
�|j�dS)NzCA loop is being detached from a child watcher with pending handlers)rKrZAbstractEventLooprjr�r�r*r+�RuntimeWarningr)r5�SIGCHLDrE�	_sig_chldr�)rr�rrrr�s
zBaseChildWatcher.attach_loopcCsFy|j�Wn4tk
r@}z|jjd|d��WYdd}~XnXdS)Nz$Unknown exception in SIGCHLD handler)r�r�)r�rZr�r�)rrCrrrr�1szBaseChildWatcher._sig_chldcCs2tj|�rtj|�Stj|�r*tj|�S|SdS)N)r{�WIFSIGNALED�WTERMSIG�	WIFEXITED�WEXITSTATUS)r�statusrrr�_compute_returncode=s



z$BaseChildWatcher._compute_returncodeN)
r�r�r�rr%r�r�r�r�r�rrrrr�sr�csPeZdZdZ�fdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
�ZS)rad'Safe' child watcher implementation.

    This implementation avoids disrupting other code spawning processes by
    polling explicitly each process in the SIGCHLD handler instead of calling
    os.waitpid(-1).

    This is a safe solution but it has a significant overhead when handling a
    big number of children (O(n) each time SIGCHLD is raised)
    cs|jj�t�j�dS)N)r�r-rr%)r)r!rrr%Vs
zSafeChildWatcher.closecCs|S)Nr)rrrrr�ZszSafeChildWatcher.__enter__cCsdS)Nr)rr�r�r�rrrr�]szSafeChildWatcher.__exit__cGs.|jdkrtd��||f|j|<|j|�dS)NzICannot add child handler, the child watcher does not have a loop attached)r�r:r�r�)rrerArBrrrrX`s

z"SafeChildWatcher.add_child_handlercCs&y|j|=dStk
r dSXdS)NTF)r�rG)rrerrrr�ks
z%SafeChildWatcher.remove_child_handlercCs"xt|j�D]}|j|�qWdS)N)r(r�r�)rrerrrr�rsz SafeChildWatcher._do_waitpid_allcCs�|dkst�ytj|tj�\}}Wn(tk
rJ|}d}tjd|�Yn0X|dkrXdS|j|�}|jj	�rztj
d||�y|jj|�\}}Wn.t
k
r�|jj	�r�tjd|dd�YnX|||f|��dS)Nr�z8Unknown child process pid %d, will report returncode 255z$process %s exited with returncode %sz'Child watcher got an unexpected pid: %rT)r�)rjr{�waitpid�WNOHANG�ChildProcessErrorrr�r�r�r�r�r��poprG)rr�rer�rfrArBrrrr�ws,


zSafeChildWatcher._do_waitpid)r�r�r�r�r%r�r�rXr�r�r�r�rr)r!rrKs	csTeZdZdZ�fdd�Z�fdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
�ZS)raW'Fast' child watcher implementation.

    This implementation reaps every terminated processes by calling
    os.waitpid(-1) directly, possibly breaking other code spawning processes
    and waiting for their termination.

    There is no noticeable overhead when handling a big number of children
    (O(1) each time a child terminates).
    cs$t�j�tj�|_i|_d|_dS)Nr)rr�	threadingZLock�_lock�_zombies�_forks)r)r!rrr�s

zFastChildWatcher.__init__cs"|jj�|jj�t�j�dS)N)r�r-r�rr%)r)r!rrr%�s

zFastChildWatcher.closec
Cs$|j�|jd7_|SQRXdS)Nr)r�r�)rrrrr��szFastChildWatcher.__enter__c
CsV|j�:|jd8_|js$|jr(dSt|j�}|jj�WdQRXtjd|�dS)Nrz5Caught subprocesses termination from unknown pids: %s)r�r�r�r;r-rr�)rr�r�r�Zcollateral_victimsrrrr��s
zFastChildWatcher.__exit__cGsz|jstd��|jdkr td��|j�:y|jj|�}Wn"tk
rZ||f|j|<dSXWdQRX|||f|��dS)NzMust use the context managerzICannot add child handler, the child watcher does not have a loop attached)	r�rjr�r:r�r�r�rGr�)rrerArBrfrrrrX�s
z"FastChildWatcher.add_child_handlercCs&y|j|=dStk
r dSXdS)NTF)r�rG)rrerrrr��s
z%FastChildWatcher.remove_child_handlercCs�x�ytjdtj�\}}Wntk
r,dSX|dkr:dS|j|�}|j�vy|jj|�\}}WnBtk
r�|j	r�||j
|<|jj�r�t
jd||�wd}YnX|jj�r�t
jd||�WdQRX|dkr�t
jd||�q|||f|��qWdS)Nrrz,unknown process %s exited with returncode %sz$process %s exited with returncode %sz8Caught subprocess termination from unknown pid: %d -> %dr2)r{r�r�r�r�r�r�r�rGr�r�r�r�rr�r�)rrer�rfrArBrrrr��s6





z FastChildWatcher._do_waitpid_all)r�r�r�r�rr%r�r�rXr�r�r�rr)r!rr�s	csHeZdZdZeZ�fdd�Zdd�Z�fdd�Zdd	�Z	d
d�Z
�ZS)�_UnixDefaultEventLoopPolicyz:UNIX event loop policy with a watcher for child processes.cst�j�d|_dS)N)rr�_watcher)r)r!rrrs
z$_UnixDefaultEventLoopPolicy.__init__c
CsHtj�8|jdkr:t�|_ttj�tj�r:|jj|j	j
�WdQRXdS)N)rr�rrrKr��current_thread�_MainThreadr��_localr�)rrrr�
_init_watchers
z)_UnixDefaultEventLoopPolicy._init_watchercs6t�j|�|jdk	r2ttj�tj�r2|jj|�dS)z�Set the event loop.

        As a side effect, if a child watcher was set before, then calling
        .set_event_loop() from the main thread will call .attach_loop(loop) on
        the child watcher.
        N)r�set_event_looprrKr�rrr�)rr�)r!rrrs
z*_UnixDefaultEventLoopPolicy.set_event_loopcCs|jdkr|j�|jS)zzGet the watcher for child processes.

        If not yet set, a SafeChildWatcher object is automatically created.
        N)rr)rrrrrV&s
z-_UnixDefaultEventLoopPolicy.get_child_watchercCs4|dkst|t�st�|jdk	r*|jj�||_dS)z$Set the watcher for child processes.N)rKrrjrr%)rrarrr�set_child_watcher0s

z-_UnixDefaultEventLoopPolicy.set_child_watcher)r�r�r�r�rZ
_loop_factoryrrrrVrr�rr)r!rrs
r)5r�r>r{r5r"ryr�r&r�r*�rrrrrrr	r
rrr
�logr�__all__r��ImportErrorr�fspathrx�AttributeErrorZBaseSelectorEventLoopr�hasattrr�r�Z
ReadTransportrNZ_FlowControlMixinZWriteTransportrTr�r�ZBaseSubprocessTransportrWrr�rrZBaseDefaultEventLoopPolicyrrrrrrr�<module>sn


O
F=On2

Youez - 2016 - github.com/yon3zu
LinuXploit