�
��fg1� � �L � d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dlmZ d dlm
Z d dlZd dl
mZ ddlmZ ddlmZmZmZmZmZmZmZmZ dd lmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z' dd
l(m)Z) ddl*m+Z+ ddl,m-Z- dd
l.m/Z/ ddl0m1Z1 ddl2m3Z3 ddl4m5Z5 ddl6m7Z7 ddl8m9Z9 ddl:m;Z; ddl<m=Z=m>Z> ddl<m?Z@ ddl<mAZAmBZB ejC jD ZD ejE eF� � ZG eH� � ZI G d� deH� � ZJejK ejL hZM G d� deJe)� � ZN G d� deN� � ZOd� ZPd� Z?dS )� )�absolute_importN)�error��timeout)�queue� )�HTTPHeaderDict)�BaseSSLError�BrokenPipeError�DummyConnection�HTTPConnection�
HTTPException�HTTPSConnection�VerifiedHTTPSConnection�port_by_scheme)
�ClosedPoolError�EmptyPoolError�HeaderParsingError�HostChangedError�InsecureRequestWarning�LocationValueError�
MaxRetryError�NewConnectionError�
ProtocolError�
ProxyError�ReadTimeoutError�SSLError�TimeoutError)�RequestMethods)�HTTPResponse)�is_connection_dropped)�connection_requires_http_tunnel)� LifoQueue)�set_file_position)�assert_header_parsing)�Retry)�CertificateError)�Timeout)�Url�_encode_target)�_normalize_host)�get_host� parse_urlc �: � e Zd ZdZdZeZdd�Zd� Zd� Z d� Z
d� ZdS ) �ConnectionPoola;
Base class for all connection pools, such as
:class:`.HTTPConnectionPool` and :class:`.HTTPSConnectionPool`.
.. note::
ConnectionPool.urlopen() does not normalize or percent-encode target URIs
which is useful if your target server doesn't support percent-encoded
target URIs.
Nc � � |st d� � �t || j �� � | _ |� � � | _ || _ d S )NzNo host specified.��scheme)r r+ r2 �host�lower�_proxy_host�port)�selfr3 r6 s �8/usr/lib/python3/dist-packages/urllib3/connectionpool.py�__init__zConnectionPool.__init__M sJ � �� ;�$�%9�:�:�:�#�D���=�=�=�� ��:�:�<�<����� � � � c �P � t | � � j �d| j �d| j �d�S )Nz(host=z, port=�))�type�__name__r3 r6 �r7 s r8 �__str__zConnectionPool.__str__U s* � �)-�d���)<�)<�)<�d�i�i�i�����S�Sr: c � � | S �N� r? s r8 � __enter__zConnectionPool.__enter__X s � ��r: c �. � | � � � dS )NF)�close)r7 �exc_type�exc_val�exc_tbs r8 �__exit__zConnectionPool.__exit__[ s � ��
�
�����ur: c � � dS )�D
Close all pooled connections and disable the pool.
NrC r? s r8 rF zConnectionPool.close` � � �
�r: rB )r> |