Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/site-packages/werkzeug/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/site-packages/werkzeug/__pycache__/serving.cpython-312.pyc

�

'ٜg������UdZddlmZddlZddlZddlZddlZddlZddlZddl	Z	ddl
ZddlmZ
ddlmZddlmZddlmZddlmZdd	lmZdd
lmZddlmZdd
lmZddlmZddlmZ	ddlZeej>ej@fZ!de"d<dZ%ejLdk(r		e'd�e(ed�Z)e)r
ejTZ*n
Gd�d�Z*	ejVZ,dZ.ej^ej`de1e2ej^e2fejfdfZ4ejjrddl6m7Z7ddl6m8Z8dd l9m:Z:dd!l;m<Z<Gd"�d#ejz�Z>Gd$�d%e�Z?d8d&�Z@	d9			d:d'�ZA	d;							d<d(�ZBd=d)�ZC	d;							d>d*�ZDd9d?d+�ZEd@d,�ZF								dAd-�ZGdBd.�ZHGd/�d0e�ZIGd1�d2ej�eI�ZKGd3�d4e*eI�ZL						dC																			dDd5�ZMdEd6�ZN													dF																																	dGd7�ZOy#e#$r#Gd�d�Z$e$�Zeej>fZ!Y���wxYw#e#$rdZ%Y���wxYw#e-$rdZ,Y���wxYw)Ha�A WSGI and HTTP server for use **during development only**. This
server is convenient to use, but is not designed to be particularly
stable, secure, or efficient. Use a dedicate WSGI server and HTTP
server when deploying to production.

It provides features like interactive debugging and code reloading. Use
``run_simple`` to start the server. Put this in a ``run.py`` script:

.. code-block:: python

    from myapp import create_app
    from werkzeug import run_simple
�)�annotationsN)�datetime)�	timedelta)�timezone)�BaseHTTPRequestHandler)�
HTTPServer)�unquote)�urlsplit���_log)�_wsgi_encoding_dance)�InternalServerError)�
uri_to_iriztuple[type[Exception], ...]�connection_dropped_errorsc��eZdZdd�Zy)�	_SslDummyc��td��)NzUSSL is unavailable because this Python runtime was not compiled with SSL/TLS support.)�RuntimeError)�self�names  �;/usr/local/lib/python3.12/site-packages/werkzeug/serving.py�__getattr__z_SslDummy.__getattr__1s���2��
�N�r�str�return�t.Any)�__name__�
__module__�__qualname__r�rrrr0s��	rrT�nt�coloramaF�forkc��eZdZy)�ForkingMixInN)rr r!r"rrr'r'Hs��rr'��ssl.SSLContext�adhoc)�WSGIApplication)�WSGIEnvironment)�RSAPrivateKeyWithSerialization)�Certificatec�0�eZdZdZdd�Zdd�Zd	d�Zd
d�Zy)�DechunkedInputz8An input stream that handles Transfer-Encoding 'chunked'c�.�||_d|_d|_y)NFr)�_rfile�_done�_len)r�rfiles  r�__init__zDechunkedInput.__init__cs�������
���	rc��y)NTr"�rs r�readablezDechunkedInput.readablehs��rc���	|jj�jd�}t|j	�d�}|dkrt
d��|S#t
$r}t
d�|�d}~wwxYw)N�latin1�zInvalid chunk headerrz!Negative chunk length not allowed)r2�readline�decode�int�strip�
ValueError�OSError)r�liner4�es    r�read_chunk_lenzDechunkedInput.read_chunk_lenksp��	9��;�;�'�'�)�0�0��:�D��t�z�z�|�R�(�D��!�8��=�>�>����	�	9��0�1�q�8��	9�s�AA�	A1� A,�,A1c��d}|j�sn|t|�k�r_|jdk(r|j�|_|jdk(rd|_|jdkDr�t	t|�|j�}||zt|�kDrW|j
j
t|�|z
�||d|xjt|�|z
zc_t|�}n;|j
j
|�||||z|xj|zc_||z
}|jdk(r)|j
j�}|dvrtd��|js|t|�kr��_|S)NrT)�
�
�
z!Missing chunk terminating newline)	r3�lenr4rE�minr2�readr=rB)r�bufrL�n�
terminators     r�readintozDechunkedInput.readintousB�����*�*���C����y�y�A�~�!�/�/�1��	��y�y�A�~�"��
��y�y�1�}���C��$�)�)�,��
�!�8�c�#�h�&�!%���!1�!1�#�c�(�T�/�!B�C���J��I�I��S��D��0�I��s�8�D�+/�;�;�+;�+;�A�+>�C��t�a�x�(��I�I��N�I��A�I�D��y�y�A�~�"�[�[�1�1�3�
��%<�<�!�"E�F�F�E�*�*���C���H�rN)r5zt.IO[bytes]r�None�r�bool�rr?)rM�	bytearrayrr?)rr r!�__doc__r6r9rErPr"rrr0r0`s��B��
��&rr0c
�6��eZdZUdZded<edd��Zdd�Zdd�Zd�fd�Z		d					dd�Z
d�fd	�Zdd
�Zdd�Z
ejged��ed
d��D��cic]	}|d|d����c}}�Zdeed�<ddd�Zd d�Zd d�Zd!d�Z�xZScc}}w)"�WSGIRequestHandlerz3A request handler that implements WSGI dispatching.�BaseWSGIServer�serverc�.�|jjS�N)rZ�_server_versionr8s r�server_versionz!WSGIRequestHandler.server_version�s���{�{�*�*�*rc��t|j�}|jj�dnd}|jsd|_n-t|jt�r|jdf|_|js(|jrd|j�|j��}n|j}t|�}idd�d|�d	|j�d
tj�d|jj�d|jj�d
d�d|j�d|j �d|j"�dd�dt%|��dt%|j&��dt%|j��dt%|j��d|j)��d|j+��|jj,dt
|jj,d�|j.d��}|j0j3�D]X\}}d|vr�|j5�j7dd�}|j7dd�}|dvrd |��}||vr
||�d!|��}|||<�Z|j9d"d�j;�j=�d#k(rd$|d%<t?|d	�|d	<|jr|jr|j|d&<	|jjAd$�'�}|�tCjD|�|d(<|S#tF$r |jjId)d*�Y|StJ$rY|SwxYw)+N�http�https)�<local>rr�/zwsgi.version)rrzwsgi.url_schemez
wsgi.inputzwsgi.errorszwsgi.multithreadzwsgi.multiprocessz
wsgi.run_onceFzwerkzeug.socket�SERVER_SOFTWARE�REQUEST_METHOD�SCRIPT_NAME��	PATH_INFO�QUERY_STRING�REQUEST_URI�RAW_URI�REMOTE_ADDR�REMOTE_PORTr)�SERVER_NAME�SERVER_PORT�SERVER_PROTOCOL�_�-z
)�CONTENT_TYPE�CONTENT_LENGTH�HTTP_�,�HTTP_TRANSFER_ENCODING�chunkedTzwsgi.input_terminated�	HTTP_HOST)�binary_form�SSL_CLIENT_CERT�errorz&Cannot fetch SSL peer certificate info)&r
�pathrZ�ssl_context�client_address�
isinstancer�scheme�netlocr	r5�sys�stderr�multithread�multiprocess�
connectionr^�commandr�query�address_string�port_integer�server_address�request_version�headers�items�upper�replace�getr@�lowerr0�getpeercert�ssl�DER_cert_to_PEM_certrA�log�AttributeError)r�request_url�
url_scheme�	path_info�environ�key�value�	peer_certs        r�make_environzWSGIRequestHandler.make_environ�sz���t�y�y�)��#�{�{�6�6�>�V�G�
��"�"�"0�D��
��+�+�S�
1�#'�#6�#6��":�D��
�!�!�k�&8�&8��K�.�.�/��0@�0@�/A�B�I�#�(�(�I��I�&�	�$
��F�$
��z�$
�
�$�*�*�$
�
�3�:�:�	$
�

���� 7� 7�$
�
 ����!9�!9�
$
�
�U�$
�
�t���$
�
�t�2�2�$
�
�d�l�l�$
�
�2�$
�
�-�i�8�$
�
�0��1B�1B�C�$
�
�/��	�	�:�$
�"
�+�D�I�I�6�#$
�$
�4�.�.�0�%$
�&
�4�,�,�.�'$
�( �;�;�5�5�a�8��t�{�{�9�9�!�<�=�#�3�3�-$
��2�,�,�,�,�.�J�C���c�z���)�)�+�%�%�c�3�/�C��M�M�&�"�-�E��<�<��c�U�m���'�>�&�s�|�n�A�e�W�5�E� �G�C�L�/��;�;�/��4�:�:�<�B�B�D�	�Q�/3�G�+�,�$2�7�<�3H�$I�G�L�!����+�"4�"4�#.�#5�#5�G�K� �	����3�3��3�E�I��$�-0�-E�-E�i�-P��)�*�����	O��K�K�O�O�G�%M�N�
��	�	����		�s�6L�%M�8M�Mc�������	�
����jjdd�j�j�dk(r�jjd��j
�x�_�d�d�d�
d�d�d������
�fd��d����fd�	�	d�����	�fd�}	|�jj�y#t$r}�j|��Yd}~yd}~wt$r�}�jjr��
�	�rd	�_	�
�d�d�|t��n#t$rYnwxYwd
dlm}||�j%�}�jj'dd
|���Yd}~yd}~wwxYw)N�Expectrgz100-continuesHTTP/1.1 100 Continue

Fc����
�Jd���
�Jd����މ
��
�		�jdd�\}}t|�}�j||�t	�}�	D]6\}}�j||�|j
|j���8d|vs<�ddk(s4d|cxkrdks)n|d	vs#�jd
k\rd��jdd
��jdd��j�t|t�sJd��|r��rY�jjtt|��ddj!���jjd��jj|��r�jjd��jj#�y#t$r�d}}Y���wxYw)Nzwrite() before start_responserrgzcontent-lengthre�HEAD�d��>�0���HTTP/1.1TzTransfer-Encodingrx�
Connection�closezapplications must write bytes�rH)�splitrAr?�
send_response�set�send_header�addr��protocol_version�end_headersr��bytes�wfile�write�hexrJ�encode�flush)�data�code_str�msg�code�header_keysr�r��chunk_responser��headers_sent�headers_setr�status_sent�
status_sets       �������rr�z*WSGIRequestHandler.run_wsgi.<locals>.writes�����)�J�+J�J�)��*�K�,K�K�*��"�(��*��4�$/�$5�$5�d�A�$>�M�H�c��8�}���"�"�4��-�!�e��".�J�C���$�$�S�%�0��O�O�C�I�I�K�0�#/�)�K�7�"�#3�4��>��4�-�#�-��:�-��-�-��;�%)�N��$�$�%8�)�D�� � ��w�7�� � �"��d�E�*�K�,K�K�*��!��J�J�$�$�S��T��^�A�B�%7�%>�%>�%@�A��J�J�$�$�W�-��
�
� � ��&�!��J�J�$�$�W�-��J�J�����]"�4�$/��c�H�4�s�F;�;
G�Gc�x��|r	�r|dj|d��	d}n
�rtd��|�|��S#d}wxYw)Nrr�zHeaders already set)�with_traceback�AssertionError)�statusr��exc_infor�r�r�r�s   ����r�start_responsez3WSGIRequestHandler.run_wsgi.<locals>.start_response<sZ����$�#�&�q�k�8�8��!��E�E�$� $�H��$�%:�;�;��J�!�K��L�� $�H�s�5�9c����|��
�}	|D]
}�|���s�d��r�	jjd�tj�}|j	�	j
tj�d}d}|jd��rN�	jjd�}|t|�z
}|dz
}|r
|dk\s|d	kDrn|jd��r�N|j�t|d
�r|j�yy#tj�}|j	�	j
tj�d}d}|jd��rN�	jjd�}|t|�z
}|dz
}|r
|dk\s|d	kDrn|jd��r�N|j�t|d
�r|j�wwxYw)Nrs0

rg{�G�z�?)�timeouti���rld(	i�r�)
r�r��	selectors�DefaultSelector�registerr��
EVENT_READ�selectr5rLrJr��hasattr)�app�application_iterr��selector�
total_size�total_readsr�r�r�rr�r�s      ������r�executez,WSGIRequestHandler.run_wsgi.<locals>.executeJs����"�7�N�;��#
-�,�D��$�K�-�#��#�J�!��J�J�$�$�\�2�%�4�4�6���!�!�$�/�/�9�3G�3G�H��
����o�o�d�o�3��:�:�?�?�:�6�D��#�d�)�+�J��1�$�K� �:��#?�;�QU�CU���o�o�d�o�3���� ��+�W�5�$�*�*�,�6��)%�4�4�6���!�!�$�/�/�9�3G�3G�H��
����o�o�d�o�3��:�:�?�?�:�6�D��#�d�)�+�J��1�$�K� �:��#?�;�QU�CU���o�o�d�o�3���� ��+�W�5�$�*�*�,�6�s�6D�B"G#�5.G#Tr)�DebugTracebackr|zError on request:
)r�r�rrQr\)r�r+rrQ)r�r�r�r@r�r�r�r�rZr�r�connection_dropped�	Exception�passthrough_errors�close_connectionr�
debug.tbtoolsr��render_traceback_textr�)
rr�rDr�r�r�r�r�r�r�r�r�r�s
`    @@@@@@@@r�run_wsgizWSGIRequestHandler.run_wsgi�s^�����<�<���H�b�)�/�/�1�7�7�9�^�K��J�J���=�>�!%�!2�!2�!4�4���w�!%�
�48��"&��59��$��7	�7	�r	�	�%	-�%	-�N	B��D�K�K�O�O�$��(�	0��#�#�A�w�/�/���	B��{�{�-�-���&�>�(,��%�
��&�!%�J�"&�K��+�-�.���
��
��
6� ��#�9�9�;�C��K�K�O�O�G�':�3�%�%@�A�A��)	B�sH�"B?�?	E9�C�E9�+"E4�D%�$E4�%	D1�.E4�0D1�1>E4�4E9c���	t�|��y#ttjf$r}|j|�Yd}~yd}~wt$r?}|jj�t|�r|jd|�n�Yd}~yd}~wwxYw)z/Handles a request ignoring dropped connections.NzSSL error occurred: %s)�super�handle�ConnectionError�socketr�r�r�rZr~�is_ssl_error�	log_error)rrD�	__class__s  �rr�zWSGIRequestHandler.handle�sr���	��G�N�������0�	'��#�#�A�&�&���	��{�{�&�&�2�|�A�����7��;��<��	�s ��B�A�B�
5B�Bc��y)z`Called if the connection was closed by the client.  By default
        nothing happens.
        Nr")rr|r�s   rr�z%WSGIRequestHandler.connection_dropped�s�rc�f��|jd�r|jStt�|�S)N�do_)�
startswithr��getattrr�)rrr�s  �rrzWSGIRequestHandler.__getattr__�s*����?�?�5�!��=�=� ��u�w��%�%rc�r�t|dd�r|jdS|jsy|jdS)Nr�rlrbr)r�r�rr8s rr�z!WSGIRequestHandler.address_string�s:���4��D�)��<�<�
�.�.��"�"���"�"�1�%�%rc� �|jdS)Nr)rr8s rr�zWSGIRequestHandler.port_integer�s���"�"�1�%�%r� ��z\x�02xz\\�\c��	t|j�}|j�d|�d|j��}|j
|j�}t|�}|ddk(r
t|d�}nb|dk(rn\|dk(r
t|d�}nJ|ddk(r
t|d	�}n5|d
k(r
t|d�}n#|ddk(rt|dd
�}n
t|dd�}|jdd|||�y#t$r|j
}Y��wxYw)N� r�1�bold�200�304�cyan�3�green�404�yellow�4�red�magenta�infoz
"%s" %s %s)rr}r�r�r��requestline�	translate�_control_char_tabler�_ansi_styler�)rr��sizer}r�s     r�log_requestzWSGIRequestHandler.log_request�s
��	#��d�i�i�(�D��\�\�N�!�D�6��4�+?�+?�*@�A�C��m�m�D�4�4�5���4�y����7�c�>��c�6�*�C�
�U�]��
�U�]��c�6�*�C�
�!�W��^��c�7�+�C�
�U�]��c�8�,�C�
�!�W��^��c�6�5�1�C��c�6�9�5�C������s�D�$�7��/�	#��"�"�C�	#�s�3C(�(D�?Dc�,�|jd|g|���y)Nr|�r��r�format�argss   rr�zWSGIRequestHandler.log_error�s�������&�(�4�(rc�,�|jd|g|���y)Nrr
rs   r�log_messagezWSGIRequestHandler.log_message�s��������'�$�'rc	��|j�jdd�}t||�d|j��d|�d�g|���y)N�%z%%z - - [z] �
)r�r�r
�log_date_time_string)r�type�messager
r�s     rr�zWSGIRequestHandler.log�sS���,�,�.�6�6�s�D�A������f�T�%>�%>�%@�$A��G�9�B�O�	
��	
r)rr)rr,�rrQr\)r|�
BaseExceptionr�zWSGIEnvironment | NonerrQrrT)rrrr)r��	int | strrrrrQ)rrr
rrrQ�rrrrr
rrrQ)rr r!rV�__annotations__�propertyr^r�r�r�r�rr�r�r�	maketrans�ranger�ordrr�rr��
__classcell__)�.0�cr�s00@rrXrX�s����=���
�+��+�O�bQB�f
�GK��"��-C��	
��&�&�&��-�-�#E�U�4�[�#E�5��t�3D�#E�F�#E�a��r�!�C��M�	�#E�F���&+���D�	�"�8�:)�(�
��O	Gs�B
rXc�R�ts|Sddddddd�}|D]
}d||�d	|��}�|�d
�S)Nr�r��!�#�$)r�rr�r�rr�z[�mz)�_log_add_style)r��styles�codes�styles    rrr�sV�����������

�E�����e��~�Q�u�g�.����W�G��rc	��	ddlm}ddlm}ddlm}ddlm}ddlm	}|�}|jdd	|�
�}|�d}|j|j|jd�|j|j |�g�}|�}|j#�j%|�j'|�j)|j)��j+|j-��j/t1j2t4j6��j9t1j2t4j6�t;d
��z�j=|j?|j@g�d��j=|jC|jE|�|jEd|���g�d��jG||jI�|�}	|	|fS#t$r
td�d�wxYw)Nr)�x509)�default_backend)�hashes)�rsa)�NameOIDz<Using ad-hoc certificates requires the cryptography library.ii)�public_exponent�key_size�backend�*zDummy Certificateim)�daysF)�criticalz*.)%�cryptographyr-�cryptography.hazmat.backendsr.�cryptography.hazmat.primitivesr/�)cryptography.hazmat.primitives.asymmetricr0�cryptography.x509.oidr1�ImportError�	TypeError�generate_private_key�Name�
NameAttribute�ORGANIZATION_NAME�COMMON_NAME�CertificateBuilder�subject_name�issuer_name�
public_key�
serial_number�random_serial_number�not_valid_before�dt�nowr�utc�not_valid_afterr�
add_extension�ExtendedKeyUsage�OID_SERVER_AUTH�SubjectAlternativeName�DNSName�sign�SHA256)
�cnr-r.r/r0r1r4�pkey�subject�certs
          r�generate_adhoc_ssl_pairrZ�s���	�%�@�9�A�1���G��#�#���g�$��D�

�z�
���i�i����w�8�8�:M�N����w�2�2�B�7�	
��G���G����!�	��g�	�	��W�	�	��D�O�O�%�	&�	��t�0�0�2�	3�	�	�"�&�&����.�	/�	��������-�	�s�0C�C�	D�	��t�,�,�d�.B�.B�-C�D�u��	U�	���'�'����b�)9�4�<�<�"�R�D�	�;R�(S�T��
�

�
��d�F�M�M�O�W�	-�	���:���K���J�
��	��s�G3�3H	c	���|�|}t|��\}}ddlm}|�d�}|�d�}t|d�5}|j	|j|jj��ddd�t|d�5}|j	|j|jj|jj|j����ddd�||fS#1swY�{xYw#1swY||fSxYw)	a�Creates an SSL key for development.  This should be used instead of
    the ``'adhoc'`` key which generates a new cert on each server start.
    It accepts a path for where it should store the key and cert and
    either a host or CN.  If a host is given it will use the CN
    ``*.host/CN=host``.

    For more information see :func:`run_simple`.

    .. versionadded:: 0.9

    :param base_path: the path to the certificate and key.  The extension
                      ``.crt`` is added for the certificate, ``.key`` is
                      added for the key.
    :param host: the name of the host.  This can be used as an alternative
                 for the `cn`.
    :param cn: the `CN` to use.
    N)rVr��
serializationz.crtz.key�wb��encodingr�encryption_algorithm)rZr:r]�openr��public_bytes�Encoding�PEM�
private_bytes�
PrivateFormat�TraditionalOpenSSL�NoEncryption)	�	base_path�hostrVrYrWr]�	cert_file�	pkey_file�fs	         r�make_ssl_devcertro)s���*��
��(�B�/�J�D�$�<��+�T�"�I��+�T�"�I�	
�i��	�!�	����!�!�-�"8�"8�"<�"<�=�>�
�	
�i��	�!�	������&�/�/�3�3�$�2�2�E�E�%2�%?�%?�%A�
�
�	
�
��i���
�	��	��i���s�5C�9AC+�C(�+C7c	��ddl}ddl}t�\}}ddlm}|j�\}}|j�\}}|j
tj|�|j
tj|�tj||j|jj��tj||j|jj|jj|j!����tj"|�tj"|�t%||�}	|	S)z:Generates an adhoc SSL context for the development server.rNr\r_)�atexit�tempfilerZr:r]�mkstempr��os�remover�rcrdrerfrgrhrir��load_ssl_context)
rqrrrYrWr]�cert_handlerl�pkey_handlerm�ctxs
          r�generate_adhoc_ssl_contextrzUs�����(�*�J�D�$�<�%�-�-�/��K��%�-�-�/��K��
�O�O�B�I�I�y�)�
�O�O�B�I�I�y�)��H�H�[�$�+�+�M�,B�,B�,F�,F�G�H��H�H�����"�+�+�/�/� �.�.�A�A�!.�!;�!;�!=�	�	
���H�H�[���H�H�[��
�9�i�
0�C��Jrc�x�|�tj}tj|�}|j||�|S)a�Loads SSL context from cert/private key files and optional protocol.
    Many parameters are directly taken from the API of
    :py:class:`ssl.SSLContext`.

    :param cert_file: Path of the certificate to use.
    :param pkey_file: Path of the private key to use. If not given, the key
                      will be obtained from the certificate file.
    :param protocol: A ``PROTOCOL`` constant from the :mod:`ssl` module.
        Defaults to :data:`ssl.PROTOCOL_TLS_SERVER`.
    )r��PROTOCOL_TLS_SERVER�
SSLContext�load_cert_chain)rlrm�protocolrys    rrvrvss8�����*�*��

�.�.��
"�C����	�9�-��Jrc��|�/tjttj�d�}t|tj�S)z?Checks if the given error (or the current one) is an SSL error.r)�t�castr�r�r�r�r��SSLError)r|s rr�r��s3���}����y�#�,�,�.��"3�4���e�S�\�\�*�*rc��|jd�rtjSd|vr ttd�rtjStj
S)zUReturn ``AF_INET4``, ``AF_INET6``, or ``AF_UNIX`` depending on
    the host and port.zunix://�:�AF_INET6)r�r��AF_UNIXr�r��AF_INET)rk�ports  r�select_address_familyr��s>�����y�!��~�~��	������4������>�>�rc�,�|tk(r1tjj|j	d�d�S	tj|||t
jt
j�}|ddS#t
j$r||fcYSwxYw)zVReturn a fully qualified socket address that can be passed to
    :func:`socket.bind`.�://r�r�)
�af_unixrtr}�abspath�	partitionr��getaddrinfo�SOCK_STREAM�IPPROTO_TCP�gaierror)rkr��family�ress    r�get_sockaddrr��s���
����w�w���t�~�~�e�4�Q�7�8�8��� � ��$��� 2� 2�F�4F�4F�
��
�q�6�!�9����?�?���T�z���s�5A9�9B�Bc�P�|tjk(rdnd}tj|tj�5}	|j|df�|j�dcddd�S#t$r#|tjk(rdndcYcddd�SwxYw#1swYyxYw)z�Get the IP address of an external interface. Used when binding to
    0.0.0.0 or ::1 to show a more useful URL.

    :meta private:
    zfd31:f903:5ab5:1::1z10.253.155.219i2�z::1�	127.0.0.1Nr)r�r��
SOCK_DGRAM�connectrB�getsockname)r�rk�ss   r�get_interface_ipr��s���%+�f�o�o�$=� �CS�D�	���v�v�0�0�	1�Q�	G�
�I�I�t�U�m�$��}�}��q�!�

2�	1���	G�"�f�o�o�5�5�;�F�	
2�	1�	G��
2�	1�s.�B�A-�B�- B�
B�B�B�B%c���eZdZdZdZdZeZdZ				d																d
�fd�
Z	dd�Z
dd
�fd�
Z						d�fd�Zdd�Z
�xZS)rYzuA WSGI server that that handles one request at a time.

    Use :func:`make_server` to create a server instance.
    FTc����|�t}dt|�vr|js|jrd|_||_||_||_||_t||�x|_
}t|t|�|�}	|tk(rP|�Ntjt |	�}	t"j$j'|	�rt#j(|	�t*�|�Y|	|d��|�"	|j/�|j1�nY|j5�tIjJ||tHjL�|_$|jHjO�|_(|tk7r|jPd|_|�RtS|tT�r	tW|�}n|dk(r
tY�}|j[|jHd
��|_$||_.nd|_.ddl/}d|j`jcd���|_2y#t2$r�}
|j5�t7|
j8t:j<��|
j>t>j@k(rRt7d|�d�t:j<��t:jBdk(r |d	k(rt7d
t:j<��t;jDd�Yd}
~
��hd}
~
wtF$r|j5��wxYw)Nr�r�F)�bind_and_activate)�filezPort zp is in use by another program. Either identify and stop that program, or start the server with a different port.�darwini�zoOn macOS, try disabling the 'AirPlay Receiver' service from System Preferences -> General -> AirDrop & Handoff.rr*T)�server_siderz	Werkzeug/�werkzeug)3rX�varsr�r�r�rkr�r�r�r��address_familyr�r?r�r�r�rrtr}�exists�unlinkr�r6�server_bind�server_activaterB�server_close�print�strerrorr�r��errno�
EADDRINUSE�platform�exitrr��fromfdr�r�r�r��tuplervrz�wrap_socketr~�importlib.metadata�metadata�versionr])
rrkr�r��handlerr�r~�fdr�r�rD�	importlibr�s
            �rr6zBaseWSGIServer.__init__�s|����?�(�G�
�T�'�]�2����� 1� 1�'1�G�$���	���	����"4���/D�T�4�/P�P���n�%�d�C��I�~�F���W�$����V�V�C��8�N��w�w�~�~�n�-��	�	�.�)�	�����#�	�	
��:�
�� � �"��$�$�&�:
����!�-�-��N�F�<N�<N�O�D�K�"&�+�+�"9�"9�";�D���W�$��+�+�A�.�D�I��"��+�u�-�.��<����'�8�:��%�1�1�$�+�+�4�1�P�D�K�6A�D��#�D��!�!*�9�+=�+=�+E�+E�j�+Q�*R�S����g�
��!�!�#��a�j�j�s�z�z�2��7�7�e�.�.�.����v�&!�!�!�Z�Z�	��|�|�x�/�D�D�L��X�!$����������� �
��!�!�#��
�s�) H�	K)�B9K�K)c��t||g|���yr\r)rrrr
s    rr�zBaseWSGIServer.log.s���T�7�"�T�"rc���	t�|�|��|j�y#t$rY�wxYw#|j�wxYw)N)�
poll_interval)r��
serve_forever�KeyboardInterruptr�)rr�r�s  �rr�zBaseWSGIServer.serve_forever1sI���	 ��G�!�
�!�>�
�����!�	��	��
����s�$�	0�3�0�3�Ac�>��|jr�t�|�	||�Sr\)r�r��handle_error)r�requestrr�s   �rr�zBaseWSGIServer.handle_error9s#����"�"���w�#�G�^�<�<rc��d}t|dd�}|g}|jtk(r|jd|j���n�|j
�dnd}|j}|jdvr�|jd	|j�d
��|jdk(rd}t
tj�}nd
}t
tj�}|jd|�d|�d|j���d|vrd|�d�}|jd|�d|�d|j���tddj|��y)z<Show information about the address when starting the server.zvWARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.r�rz * Running on Nr`ra>�::�0.0.0.0z * Running on all addresses (�)r�r�z[::1]r�r��[�]rr)
rr�r��appendrkr~r�r�r�r�r�r
�join)r�dev_warning�messagesr��display_hostname�	localhosts      r�log_startupzBaseWSGIServer.log_startupAs5��
A�	�"�+�v�u�=���=�����'�)��O�O�n�T�Y�Y�K�8�9�#�/�/�7�V�W�F�#�y�y���y�y�-�-����"?��	�	�{�!� L�M��9�9�	�)� +�I�'7����'G�$� '�I�'7����'H�$����.����I�;�a��	�	�{� S�T��&�&�%&�'7�&8��#:� ��O�O�n�V�H�C�8H�7I��4�9�9�+�V�W��V�T�Y�Y�x�(�)r)NFNN)rkrr�r?r�r+r��type[WSGIRequestHandler] | Noner�rSr~�_TSSLContextArg | Noner��
int | NonerrQr)g�?)r��floatrrQ)r�rr�tuple[str, int] | strrrQr)rr r!rVr�r��LISTEN_QUEUE�request_queue_size�allow_reuse_addressr6r�r�r�r�r�r�s@rrYrY�s�����
�K��L�%����48�#(�.2��eT��eT��eT��	eT�
1�eT�!�
eT�,�eT�
�eT�
�eT�N#� �=��=�.C�=�	
�=� *rrYc��eZdZdZdZdZy)�ThreadedWSGIServerz�A WSGI server that handles concurrent requests in separate
    threads.

    Use :func:`make_server` to create a server instance.
    TN)rr r!rVr��daemon_threadsr"rrr�r�ds����K��Nrr�c�V��eZdZdZdZ					d																	d�fd�
Z�xZS)�ForkingWSGIServerz�A WSGI server that handles concurrent requests in separate forked
    processes.

    Use :func:`make_server` to create a server instance.
    Tc		�`��tstd��t�	|�
|||||||�||_y)Nz'Your platform does not support forking.)�can_forkrAr�r6�max_children)
rrkr�r��	processesr�r�r~r�r�s
         �rr6zForkingWSGIServer.__init__xs7�����F�G�G�
����t�S�'�3E�{�TV�W�%��r)�(NFNN)rkrr�r?r�r+r�r?r�r�r�rSr~r�r�r�rrQ)rr r!rVr�r6rr�s@rr�r�os������L��37�#(�.2��&��&��&��	&�
�&�1�
&�!�&�,�&�
�&�
�&�&rr�c	
��|r|dkDrtd��|rt|||||||��S|dkDrt||||||||��St|||||||��S)a6Create an appropriate WSGI server instance based on the value of
    ``threaded`` and ``processes``.

    This is called from :func:`run_simple`, but can be used separately
    to have access to the server object, such as to run it in a separate
    thread.

    See :func:`run_simple` for parameter docs.
    rz4Cannot have a multi-thread and multi-process server.�r�)rAr�r�rY)	rkr�r��threadedr��request_handlerr�r~r�s	         r�make_serverr��s���(�I��M��O�P�P��!��$��_�.@�+�RT�
�	
��1�}� ���������	
�		
���d�C��*<�k�b��rc�F�tjjd�dk(S)zqCheck if the server is running as a subprocess within the
    Werkzeug reloader.

    .. versionadded:: 0.10
    �WERKZEUG_RUN_MAIN�true)rtr�r�r"rr�is_running_from_reloaderr��s���:�:�>�>�-�.�&�8�8rc���t|t�std��|
rddlm}|||
�}|r+ddlm}|||��}|jj|�t�sd}nttjd�}t||||
|||||��	}|jjd	�t|j!��tjd<t�s&|j#�t%d
t'dd��|r/dd
lm}	||j,||||	��|j/�y|j-�y#|j/�wxYw)aStart a development server for a WSGI application. Various
    optional features can be enabled.

    .. warning::

        Do not use the development server when deploying to production.
        It is intended for use only during local development. It is not
        designed to be particularly efficient, stable, or secure.

    :param hostname: The host to bind to, for example ``'localhost'``.
        Can be a domain, IPv4 or IPv6 address, or file path starting
        with ``unix://`` for a Unix socket.
    :param port: The port to bind to, for example ``8080``. Using ``0``
        tells the OS to pick a random free port.
    :param application: The WSGI application to run.
    :param use_reloader: Use a reloader process to restart the server
        process when files are changed.
    :param use_debugger: Use Werkzeug's debugger, which will show
        formatted tracebacks on unhandled exceptions.
    :param use_evalex: Make the debugger interactive. A Python terminal
        can be opened for any frame in the traceback. Some protection is
        provided by requiring a PIN, but this should never be enabled
        on a publicly visible server.
    :param extra_files: The reloader will watch these files for changes
        in addition to Python modules. For example, watch a
        configuration file.
    :param exclude_patterns: The reloader will ignore changes to any
        files matching these :mod:`fnmatch` patterns. For example,
        ignore cache files.
    :param reloader_interval: How often the reloader tries to check for
        changes.
    :param reloader_type: The reloader to use. The ``'stat'`` reloader
        is built in, but may require significant CPU to watch files. The
        ``'watchdog'`` reloader is much more efficient but requires
        installing the ``watchdog`` package first.
    :param threaded: Handle concurrent requests using threads. Cannot be
        used with ``processes``.
    :param processes: Handle concurrent requests using up to this number
        of processes. Cannot be used with ``threaded``.
    :param request_handler: Use a different
        :class:`~BaseHTTPServer.BaseHTTPRequestHandler` subclass to
        handle requests.
    :param static_files: A dict mapping URL prefixes to directories to
        serve static files from using
        :class:`~werkzeug.middleware.SharedDataMiddleware`.
    :param passthrough_errors: Don't catch unhandled exceptions at the
        server level, let the server crash instead. If ``use_debugger``
        is enabled, the debugger will still catch such errors.
    :param ssl_context: Configure TLS to serve over HTTPS. Can be an
        :class:`ssl.SSLContext` object, a ``(cert_file, key_file)``
        tuple to create a typical context, or the string ``'adhoc'`` to
        generate a temporary self-signed certificate.

    .. versionchanged:: 2.1
        Instructions are shown for dealing with an "address already in
        use" error.

    .. versionchanged:: 2.1
        Running on ``0.0.0.0`` or ``::`` shows the loopback IP in
        addition to a real IP.

    .. versionchanged:: 2.1
        The command-line interface was removed.

    .. versionchanged:: 2.0
        Running on ``0.0.0.0`` or ``::`` shows a real IP address that
        was bound as well as a warning not to run the development server
        in production.

    .. versionchanged:: 2.0
        The ``exclude_patterns`` parameter was added.

    .. versionchanged:: 0.15
        Bind to a Unix socket by passing a ``hostname`` that starts with
        ``unix://``.

    .. versionchanged:: 0.10
        Improved the reloader and added support for changing the backend
        through the ``reloader_type`` parameter.

    .. versionchanged:: 0.9
        A command-line interface was added.

    .. versionchanged:: 0.8
        ``ssl_context`` can be a tuple of paths to the certificate and
        private key files.

    .. versionchanged:: 0.6
        The ``ssl_context`` parameter was added.

    .. versionchanged:: 0.5
       The ``static_files`` and ``passthrough_errors`` parameters were
       added.
    zport must be an integerr)�SharedDataMiddleware)�DebuggedApplication)�evalexN�WERKZEUG_SERVER_FDr�TrzPress CTRL+C to quitr�)�run_with_reloader)�extra_files�exclude_patterns�interval�
reloader_type)r�r?r>�middleware.shared_datar��debugr��
trusted_hostsr�r�rtr�r�r��set_inheritabler�filenor�r
r�	_reloaderr�r�r�)�hostnamer��application�use_reloader�use_debugger�
use_evalexr�r��reloader_intervalr�r�r�r��static_filesr�r~r�r�r��srvr�s                     r�
run_simpler�s;��`�d�C� ��1�2�2��@�*�;��E���.�)�+�j�I��	�!�!�(�(��2�#�%�
��
����0�1�
2��
���������
�
�C��J�J���t�$�'*�3�:�:�<�'8�B�J�J�#�$�#�%������V�[�!7��B�C��0�		���!�!�'�!1�*�+�
�
���������
����s�E�E )r�rr)rrrr\)rV�
str | Nonerz2tuple[Certificate, RSAPrivateKeyWithSerialization])NN)rjrrkrrVrrztuple[str, str])rr))rlrrmrrr�rr))r|zException | NonerrS)rkrr�r?r�socket.AddressFamily)rkrr�r?r�rrr�)r�rrr)FrNFNN)rkrr�r?r�r+r�rSr�r?r�r�r�rSr~r�r�r�rrYrR)
FFTNNr�autoFrNNFN)"r�rr�r?r�r+r�rSrrSrrSr��t.Iterable[str] | Noner�r	rr?r�rr�rSr�r?r�r�rz'dict[str, str | tuple[str, str]] | Noner�rSr~r�rrQ)PrV�
__future__rr��iortr�r��socketserverr��typingr�rrKrr�http.serverrr�urllib.parser	r
�	_internalr
r�
exceptionsr�urlsrr�r�r��SSLEOFErrorrrr=rr(r�
__import__r�r�r'r�r�r�r��Optional�Unionr�r�Literal�_TSSLContextArg�
TYPE_CHECKING�_typeshed.wsgir+r,�-cryptography.hazmat.primitives.asymmetric.rsar-�cryptography.x509r.�	RawIOBaser0rXrrZrorzrvr�r�r�r�rY�ThreadingMixInr�r�r�r�rr"rr�<module>rs����#��	�	��
��
��#���.�"� �!��+�+��B��	�������>��:��"���7�7�d�?���:���2�v�����,�,�L�
�
���n�n�G����*�*��G�G��e�C����C��$8�9�1�9�9�W�;M�M�N����?�?�.�.��.�;�R�\�\�;�|D
�/�D
�N
�(�.��.�7�.�d?C�) ��) �$�) �1;�) ��) �X�>JN����)��<F����*+���

����"6����""�$e*�Z�e*�P��4�4�n��&��n�&�>��7;�$�*.��*�

�*�

�*�
�*��	*�
�*�5�
*��*�(�*�	�*��*�Z9����*.�/3�����7;�<@�$�*.�!e��e�

�e�!�e��	e�
�e��
e�(�e�-�e��e��e��e��e�5�e�:�e��e� (�!e�"
�#e��e�
B����+�C�!0�&�.�.� A��
B��"���������G��s6�-"H#�!I�I�#$I�
I�I�I�I'�&I'

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists