$48 GRAYBYTE WORDPRESS FILE MANAGER $74

SERVER : in-mum-web1330.main-hosting.eu #1 SMP Mon Feb 10 22:45:17 UTC 2025
SERVER IP : 147.79.69.6 | ADMIN IP 216.73.216.215
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/python311/lib/python3.11/site-packages/urllib3/__pycache__/

HOME
Current File : /opt/alt/python311/lib/python3.11/site-packages/urllib3/__pycache__//poolmanager.cpython-311.pyc
�

q�;fN���ddlmZddlZddlZddlZddlmZmZddlm	Z	m
Z
mZddlm
Z
mZmZmZmZddlmZddlmZdd	lmZdd
lmZddlmZddlmZgd
�Zeje ��Z!dZ"dZ#ej$de#��Z%dZ&ej$de&��Z'd�Z(ej)e(e%��ej)e(e%��d�Z*e	e
d�Z+Gd�de��Z,Gd�de,��Z-d�Z.dS)�)�absolute_importN�)�HTTPHeaderDict�RecentlyUsedContainer)�HTTPConnectionPool�HTTPSConnectionPool�port_by_scheme)�LocationValueError�
MaxRetryError�ProxySchemeUnknown�ProxySchemeUnsupported�URLSchemeUnknown)�six)�urljoin)�RequestMethods)�connection_requires_http_tunnel)�Retry)�	parse_url)�PoolManager�ProxyManager�proxy_from_url)	�key_file�	cert_file�	cert_reqs�ca_certs�ssl_version�ca_cert_dir�ssl_context�key_password�server_hostname)�
key_scheme�key_host�key_port�key_timeout�key_retries�
key_strict�	key_block�key_source_address�key_key_file�key_key_password�
key_cert_file�
key_cert_reqs�key_ca_certs�key_ssl_version�key_ca_cert_dir�key_ssl_context�key_maxsize�key_headers�
key__proxy�key__proxy_headers�key__proxy_config�key_socket_options�key__socks_options�key_assert_hostname�key_assert_fingerprint�key_server_hostname�PoolKey)r�use_forwarding_for_https�ProxyConfigc��|���}|d���|d<|d���|d<dD]8}||vr2||�*t||�����||<�9|�d��}|�t|��|d<t
|�����D]}|�|��|d|z<�|j	D]}||vrd||<�|di|��S)a�
    Create a pool key out of a request context dictionary.

    According to RFC 3986, both the scheme and host are case-insensitive.
    Therefore, this function normalizes both before constructing the pool
    key for an HTTPS request. If you wish to change this behaviour, provide
    alternate callables to ``key_fn_by_scheme``.

    :param key_class:
        The class to use when constructing the key. This should be a namedtuple
        with the ``scheme`` and ``host`` keys at a minimum.
    :type  key_class: namedtuple
    :param request_context:
        A dictionary-like object that contain the context for a request.
    :type  request_context: dict

    :return: A namedtuple that can be used as a connection pool key.
    :rtype:  PoolKey
    �scheme�host)�headers�_proxy_headers�_socks_optionsN�socket_options�key_�)
�copy�lower�	frozenset�items�get�tuple�list�keys�pop�_fields)�	key_class�request_context�context�key�socket_opts�fields      �F/opt/alt/python311/lib/python3.11/site-packages/urllib3/poolmanager.py�_default_key_normalizerrXOs8��*�"�"�$�$�G���)�/�/�1�1�G�H���f�o�+�+�-�-�G�F�O�?�;�;���'�>�>�g�c�l�6�$�W�S�\�%7�%7�%9�%9�:�:�G�C�L���+�+�.�/�/�K���$)�+�$6�$6�� �!��G�L�L�N�N�#�#�1�1�� '���C� 0� 0��������"�"�"������!�G�E�N���9���w������http�httpsc�t�eZdZdZdZdZdd�Zd�Zd�Zdd�Z	d�Z
dd
�Zd�Zdd�Z
dd
�Zd�Zd�Zd�Zdd�ZdS)ra$
    Allows for arbitrary requests while transparently keeping track of
    necessary connection pools for you.

    :param num_pools:
        Number of connection pools to cache before discarding the least
        recently used pool.

    :param headers:
        Headers to include with all requests, unless other headers are given
        explicitly.

    :param \**connection_pool_kw:
        Additional parameters are used to create fresh
        :class:`urllib3.connectionpool.ConnectionPool` instances.

    Example::

        >>> manager = PoolManager(num_pools=2)
        >>> r = manager.request('GET', 'http://google.com/')
        >>> r = manager.request('GET', 'http://google.com/mail')
        >>> r = manager.request('GET', 'http://yahoo.com/')
        >>> len(manager.pools)
        2

    N�
c��tj||��||_t|��|_t
|_t���|_dS�N)r�__init__�connection_pool_kwr�pools�pool_classes_by_scheme�key_fn_by_schemerG)�self�	num_poolsrArbs    rWrazPoolManager.__init__�sP�����g�.�.�.�"4���*�9�5�5��
�'=��#� 0� 5� 5� 7� 7����rYc��|Sr`rF�rfs rW�	__enter__zPoolManager.__enter__�s���rYc�.�|���dS)NF)�clear)rf�exc_type�exc_val�exc_tbs    rW�__exit__zPoolManager.__exit__�s���
�
�����urYc���|j|}|�|j���}dD]}|�|d���|dkr tD]}|�|d���|||fi|��S)a�
        Create a new :class:`urllib3.connectionpool.ConnectionPool` based on host, port, scheme, and
        any additional pool keyword arguments.

        If ``request_context`` is provided, it is provided as keyword arguments
        to the pool class used. This method is used to actually create the
        connection pools handed out by :meth:`connection_from_url` and
        companion methods. It is intended to be overridden for customization.
        N)r?r@�portr[)rdrbrGrO�SSL_KEYWORDS)rfr?r@rrrR�pool_clsrT�kws        rW�	_new_poolzPoolManager._new_pool�s����.�v�6���"�"�5�:�:�<�<�O�.�	+�	+�C�����T�*�*�*�*��V���"�
.�
.���#�#�B��-�-�-�-��x��d�6�6�o�6�6�6rYc�8�|j���dS)z�
        Empty our store of pools and direct them all to close.

        This will not affect in-flight connections, but they will not be
        re-used after completion.
        N)rcrlris rWrlzPoolManager.clear�s��	
�
�������rYr[c��|std���|�|��}|pd|d<|s-tj|d���d��}||d<||d<|�|��S)a�
        Get a :class:`urllib3.connectionpool.ConnectionPool` based on the host, port, and scheme.

        If ``port`` isn't given, it will be derived from the ``scheme`` using
        ``urllib3.connectionpool.port_by_scheme``. If ``pool_kwargs`` is
        provided, it is merged with the instance's ``connection_pool_kw``
        variable and used to create the new connection pool, if one is
        needed.
        zNo host specified.r[r?�Prrr@)r
�_merge_pool_kwargsr	rKrH�connection_from_context)rfr@rrr?�pool_kwargsrRs      rW�connection_from_hostz PoolManager.connection_from_host�s����	;�$�%9�:�:�:��1�1�+�>�>��$*�$4�f���!��	M�!�%�o�h�&?�&E�&E�&G�&G��L�L�D�"&����"&�����+�+�O�<�<�<rYc���|d���}|j�|��}|st|���||��}|�||���S)z�
        Get a :class:`urllib3.connectionpool.ConnectionPool` based on the request context.

        ``request_context`` must at least contain the ``scheme`` key and its
        value must be a key in ``key_fn_by_scheme`` instance variable.
        r?�rR)rHrerKr�connection_from_pool_key)rfrRr?�pool_key_constructor�pool_keys     rWr{z#PoolManager.connection_from_context�sp��!��*�0�0�2�2��#�4�8�8��@�@��#�	+�"�6�*�*�*�'�'��8�8���,�,�X��,�W�W�WrYc��|jj5|j�|��}|r|cddd��S|d}|d}|d}|�||||���}||j|<ddd��n#1swxYwY|S)a
        Get a :class:`urllib3.connectionpool.ConnectionPool` based on the provided pool key.

        ``pool_key`` should be a namedtuple that only contains immutable
        objects. At a minimum it must have the ``scheme``, ``host``, and
        ``port`` fields.
        Nr?r@rrr)rc�lockrKrv)rfr�rR�poolr?r@rrs       rWr�z$PoolManager.connection_from_pool_keys����Z�_�	(�	(��:�>�>�(�+�+�D��
��	(�	(�	(�	(�	(�	(�	(�	(�%�X�.�F�"�6�*�D�"�6�*�D��>�>�&�$��o�>�V�V�D�#'�D�J�x� �	(�	(�	(�	(�	(�	(�	(�	(�	(�	(�	(����	(�	(�	(�	(��s�A?�;A?�?B�Bc�p�t|��}|�|j|j|j|���S)a�
        Similar to :func:`urllib3.connectionpool.connection_from_url`.

        If ``pool_kwargs`` is not provided and a new pool needs to be
        constructed, ``self.connection_pool_kw`` is used to initialize
        the :class:`urllib3.connectionpool.ConnectionPool`. If ``pool_kwargs``
        is provided, it is used instead. Note that if a new pool does not
        need to be created for the request, the provided ``pool_kwargs`` are
        not used.
        )rrr?r|)rr}r@rrr?)rf�urlr|�us    rW�connection_from_urlzPoolManager.connection_from_urls;��
�c�N�N���(�(�
�F�����k�)�
�
�	
rYc��|j���}|r6|���D]!\}}|�	||=�#t$rY�wxYw|||<�"|S)a
        Merge a dictionary of override values for self.connection_pool_kw.

        This does not modify self.connection_pool_kw and returns a new dict.
        Any keys in the override dictionary with a value of ``None`` are
        removed from the merged dictionary.
        )rbrGrJ�KeyError)rf�override�base_pool_kwargsrT�values     rWrzzPoolManager._merge_pool_kwargs/s��� �2�7�7�9�9���	2�&�n�n�.�.�
2�
2�
��U��=��,�S�1�1��#����������-2�$�S�)�)��s�<�
A	�A	c�V�|j�dSt|j|j|j��S)z�
        Indicates if the proxy requires the complete destination URL in the
        request.  Normally this is only needed when not using an HTTP CONNECT
        tunnel.
        NF)�proxyr�proxy_configr?)rf�
parsed_urls  rW�!_proxy_requires_url_absolute_formz-PoolManager._proxy_requires_url_absolute_formCs7���:���5�2��J��)�:�+<�
�
�
�	
rYc��|j�|dkrdS|jjdkrdStjr|jjst
d���dSdS)z�
        Validates that were not attempting to do TLS in TLS connections on
        Python2 or with unsupported SSL implementations.
        Nr\zfContacting HTTPS destinations through HTTPS proxies 'via CONNECT tunnels' is not supported in Python 2)r�r?r�PY2r�r<r
)rf�
url_schemes  rW�$_validate_proxy_scheme_url_selectionz0PoolManager._validate_proxy_scheme_url_selectionPss��
�:���w�!6�!6��F��:���'�'��F��7�	�4�,�E�	�(�E���
�	�	�	�	rYTc���t|��}|�|j��|�|j|j|j���}d|d<d|d<d|vr|j���|d<|�|��r|j	||fi|��}n|j	||j
fi|��}|o|���}|s|St||��}|j
dkr1d}d|d	<t|d�����|d<|�d
��}	t#|	t$��st%j|	|���}	|	jrx|�|��sct-t/j|d����}
|
D]9}|���|	jvr|d�|d���:	|	�||||���}	n.#t8$r!|	jr|����|cYSwxYw|	|d
<||d<t>� d
||��|���|j	||fi|��S)aN
        Same as :meth:`urllib3.HTTPConnectionPool.urlopen`
        with custom cross-host redirect logic and only sends the request-uri
        portion of the ``url``.

        The given ``url`` parameter must be absolute, such that an appropriate
        :class:`urllib3.connectionpool.ConnectionPool` can be chosen for it.
        )rrr?F�assert_same_host�redirectrAi/�GETN�body�retries)r�)�response�_poolzRedirecting %s -> %s)!rr�r?r}r@rrrArGr��urlopen�request_uri�get_redirect_locationr�statusr�_prepare_for_method_changerK�
isinstancer�from_int�remove_headers_on_redirect�is_same_hostrMr�iterkeysrHrO�	incrementr�raise_on_redirect�
drain_conn�log�info)rf�methodr�r�rur��connr��redirect_locationr�rA�headers            rWr�zPoolManager.urlopenas���
�c�N�N���1�1�!�(�;�;�;��(�(���a�f�Q�X�(�N�N��!&������:���B��� �L�-�-�/�/�B�y�M��1�1�!�4�4�	A�#�t�|�F�C�6�6�2�6�6�H�H�#�t�|�F�A�M�@�@�R�@�@�H�$�I��)G�)G�)I�)I�� �	��O�$�C�):�;�;���?�c�!�!��F��B�v�J�*�2�i�=�9�9�T�T�V�V�B�y�M��&�&��#�#���'�5�)�)�	A��n�W�x�@�@�@�G�
�-�	4�d�6G�6G��7
�7
�	4��3�<��9�
�6�6�7�7�G�!�
4�
4���<�<�>�>�W�%G�G�G��y�M�%�%�f�d�3�3�3��	��'�'���h�d�'�S�S�G�G���	�	�	��(�
��#�#�%�%�%���O�O�O�		���� ��9�
�!��:�����'��.?�@�@�@��������t�|�F�$5�<�<��<�<�<s�G4�4(H�H)r^Nr`�Nr[N�T)�__name__�
__module__�__qualname__�__doc__r�r�rarjrprvrlr}r{r�r�rzr�r�r�rFrYrWrr�s��������6
�E��L�8�8�8�8�������
7�7�7�7�6���=�=�=�=�.
X�
X�
X�����0
�
�
�
�  � � �(
�
�
����"D=�D=�D=�D=�D=�D=rYrc�N��eZdZdZ					d�fd�	Zd�fd�	Zd
d�Zd�fd
�	Z�xZS)ra>
    Behaves just like :class:`PoolManager`, but sends all requests through
    the defined proxy, using the CONNECT method for HTTPS URLs.

    :param proxy_url:
        The URL of the proxy to be used.

    :param proxy_headers:
        A dictionary containing headers that will be sent to the proxy. In case
        of HTTP they are being sent with each request, while in the
        HTTPS/CONNECT case they are sent only once. Could be used for proxy
        authentication.

    :param proxy_ssl_context:
        The proxy SSL context is used to establish the TLS connection to the
        proxy when using HTTPS proxies.

    :param use_forwarding_for_https:
        (Defaults to False) If set to True will forward requests to the HTTPS
        proxy to be made on behalf of the client instead of creating a TLS
        tunnel via the CONNECT method. **Enabling this flag means that request
        and response headers and content will be visible from the HTTPS proxy**
        whereas tunneling keeps request and response headers and content
        private.  IP address, target hostname, SNI, and port are always visible
        to an HTTPS proxy even when this flag is disabled.

    Example:
        >>> proxy = urllib3.ProxyManager('http://localhost:3128/')
        >>> r1 = proxy.request('GET', 'http://google.com/')
        >>> r2 = proxy.request('GET', 'http://httpbin.org/')
        >>> len(proxy.pools)
        1
        >>> r3 = proxy.request('GET', 'https://httpbin.org/')
        >>> r4 = proxy.request('GET', 'https://twitter.com/')
        >>> len(proxy.pools)
        3

    r^NFc���t|t��rd|j|j|jfz}t|��}|jdvrt
|j���|js0tj|jd��}	|�	|	���}||_
|pi|_||_t||��|_|j
|d<|j|d<|j|d<tt |��j||fi|��dS)Nz
%s://%s:%irZry)rr�_proxyrB�
_proxy_config)r�rr?r@rrrrr	rK�_replacer��
proxy_headers�proxy_ssl_contextr=r��superrra)rf�	proxy_urlrgrAr�r�r<rbr�rr�	__class__s          �rWrazProxyManager.__init__�s����i�!3�4�4�	�$�� �����(��I�
�)�$�$���<�0�0�0�$�U�\�2�2�2��z�	.�!�%�e�l�B�7�7�D��N�N��N�-�-�E���
�*�0�b���!2���'�(9�;S�T�T���'+�z��8�$�/3�/A��+�,�.2�.?��?�+�*��l�D�!�!�*�9�g�T�T�AS�T�T�T�T�TrYr[c���|dkr,tt|���||||���Stt|���|jj|jj|jj|���S)Nr\)r|)r�rr}r�r@rrr?)rfr@rrr?r|r�s     �rWr}z!ProxyManager.connection_from_host�s~����W�����t�,�,�A�A��d�F��B���
��\�4�(�(�=�=��J�O�T�Z�_�d�j�.?�[�>�
�
�	
rYc�r�ddi}t|��j}|r||d<|r|�|��|S)z�
        Sets headers needed by proxies: specifically, the Accept and Host
        headers. Only sets headers not provided by the user.
        �Acceptz*/*�Host)r�netloc�update)rfr�rA�headers_r�s     rW�_set_proxy_headerszProxyManager._set_proxy_headers�sM��
�e�$���3���&���	&�%�H�V���	%��O�O�G�$�$�$��rYTc���t|��}t|j|j|j��s4|�d|j��}|�||��|d<tt|��j
||fd|i|��S)z@Same as HTTP(S)ConnectionPool.urlopen, ``url`` must be absolute.rAr�)rrr�r�r?rKrAr�r�rr�)rfr�r�r�rur�rAr�s       �rWr�zProxyManager.urlopens�����c�N�N��.�t�z�4�;L�a�h�W�W�	B��f�f�Y���5�5�G� �3�3�C��A�A�B�y�M�0�u�\�4�(�(�0���V�V�x�V�SU�V�V�VrY)r^NNNFr�r`r�)	r�r�r�r�rar}r�r��
__classcell__)r�s@rWrr�s��������%�%�T����!&�#U�#U�#U�#U�#U�#U�J
�
�
�
�
�
�
�
�
�
�
W�
W�
W�
W�
W�
W�
W�
W�
W�
WrYrc��tdd|i|��S)Nr�rF)r)r�rus  rWrrs���,�,�#�,��,�,�,rY)/�
__future__r�collections�	functools�logging�_collectionsrr�connectionpoolrrr	�
exceptionsr
rrr
r�packagesr�packages.six.moves.urllib.parser�requestr�
util.proxyr�
util.retryr�util.urlr�__all__�	getLoggerr�r�rs�_key_fields�
namedtupler;�_proxy_config_fieldsr=rX�partialrerdrrrrFrYrW�<module>r�s]��&�&�&�&�&�&�������������?�?�?�?�?�?�?�?�S�S�S�S�S�S�S�S�S�S���������������������4�4�4�4�4�4�#�#�#�#�#�#�7�7�7�7�7�7�������������
;�
;�
;���g���!�!��
����>!�+�
 ��K�
8�
8��B��$�k�$�]�4H�I�I��. �. �. �l
�I��5�w�?�?�
�Y�
�6��
@�
@����
#5�?R�S�S��Y=�Y=�Y=�Y=�Y=�.�Y=�Y=�Y=�xpW�pW�pW�pW�pW�;�pW�pW�pW�f-�-�-�-�-rY

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
8 May 2024 6.33 PM
root / root
0755
__init__.cpython-311.pyc
3.602 KB
8 May 2024 6.33 PM
root / root
0644
_collections.cpython-311.pyc
18.424 KB
8 May 2024 6.33 PM
root / root
0644
_version.cpython-311.pyc
0.193 KB
8 May 2024 6.33 PM
root / root
0644
connection.cpython-311.pyc
21.527 KB
8 May 2024 6.33 PM
root / root
0644
connectionpool.cpython-311.pyc
37.555 KB
8 May 2024 6.33 PM
root / root
0644
exceptions.cpython-311.pyc
15.725 KB
8 May 2024 6.33 PM
root / root
0644
fields.cpython-311.pyc
11.128 KB
8 May 2024 6.33 PM
root / root
0644
filepost.cpython-311.pyc
4.371 KB
8 May 2024 6.33 PM
root / root
0644
poolmanager.cpython-311.pyc
21.287 KB
8 May 2024 6.33 PM
root / root
0644
request.cpython-311.pyc
7.468 KB
8 May 2024 6.33 PM
root / root
0644
response.cpython-311.pyc
35.88 KB
8 May 2024 6.33 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF