File: //home/arjun/projects/env/lib/python3.10/site-packages/boto/__pycache__/connection.cpython-310.pyc
o
we3� � @ s d Z ddlmZ ddlZddlZddlZddlZddlZddlZddlZddl Z
ddlZddlm
Z
ddlmZ ddlZddlZddlZddlZddlmZmZ ddlmZmZmZmZmZ ddlmZ dd lmZ dd
lmZ ddlmZ ddlm Z dd
l!m"Z" dZ#zddl$Z$ddlm%Z% e&e$d�r�dZ#W n e'y� Y nw zddl(Z(W n
e'y� ddl)Z(Y nw e*dd� dD ��Z+ddd�Z,ej-�.ej-�/ej-�0ej1j2��d�Z3G dd� de4�Z5G dd� de4�Z6G dd� de4�Z7G dd � d ej8�Z8G d!d"� d"e4�Z9G d#d$� d$e9�Z:dS )%z"
Handles basic connections to AWS
� )�datetimeN)�auth)�auth_handler)�config� UserAgent)�six�http_client�urlparse�quote�encodebytes)�AWSConnectionError)�BotoClientError)�BotoServerError)�PleaseRetryException)�Provider)� ResultSetF)�https_connection�SSLErrorTc c s � | ]}|t jv V qd S �N)�os�environ)�.0�key� r �H/home/arjun/projects/env/lib/python3.10/site-packages/boto/connection.py� <genexpr>W s � r )�
USER_IS_ADMIN�CURRENT_VERSION_ID�APPLICATION_ID� �P )TFzcacerts.txtc @ sH e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
d� Zdd
� Z dd� Z
dS )�HostConnectionPoola�
A pool of connections for one remote (host,port,is_secure).
When connections are added to the pool, they are put into a
pending queue. The _mexe method returns connections to the pool
before the response body has been read, so they connections aren't
ready to send another request yet. They stay in the pending queue
until they are ready for another request, at which point they are
returned to the pool of ready connections.
The pool of ready connections is an ordered list of
(connection,time) pairs, where the time is the time the connection
was returned from _mexe. After a certain period of time,
connections are considered stale, and discarded rather than being
reused. This saves having to wait for the connection to time out
if AWS has decided to close it on the other end because of
inactivity.
Thread Safety:
This class is used only from ConnectionPool while it's mutex
is held.
c C s
g | _ d S r )�queue��selfr r r �__init__z �
zHostConnectionPool.__init__c C s
t | j�S )z�
Returns the number of connections in the pool for this host.
Some of the connections may still be in use, and may not be
ready to be returned by get().
)�lenr"