Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/site-packages/boto3/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/site-packages/boto3/__pycache__/crt.cpython-38.pyc
U

Q��g�@s�dZddlZddlZddlmZddlmZmZm	Z	m
Z
mZdada
e��ZdZdd�Zdd	�Zd
d�Zdd
�Zdd�ZGdd�d�Zdd�Zdd�Zdd�ZdS)a6
This file contains private functionality for interacting with the AWS
Common Runtime library (awscrt) in boto3.

All code contained within this file is for internal usage within this
project and is not intended for external consumption. All interfaces
contained within are subject to abrupt breaking changes.
�N)�Session)�BotocoreCRTCredentialsWrapper�BotocoreCRTRequestSerializer�CRTTransferManager�acquire_crt_s3_process_lock�create_s3_crt_clientZboto3cCs|d|d�}tf|�S)z�Create a CRT S3 Client for file transfer.

    Instantiating many of these may lead to degraded performance or
    system resource exhaustion.
    T)�regionZuse_sslZcrt_credentials_provider)r)�session�config�region_name�
cred_providerZcreate_crt_client_kwargs�r
�6/opt/cppython/lib/python3.8/site-packages/boto3/crt.py�_create_crt_client*s
�rcCst||dd��S)N)rZendpoint_url)r)r	rr
r
r�_create_crt_request_serializer8s�rcKs(t|�}|��}tt||||�|||�S)zFCreate boto3 wrapper class to manage crt lock reference and S3 client.)rZto_crt_credentials_provider�CRTS3Clientr)r	r
r�credentials�lock�kwargsZcred_wrapperrr
r
r�_create_crt_s3_client>s�rcCsLtt�}|dkrdSt�}|jj}|��}t||�}t|||||�}||fS)N)NN)r�PROCESS_LOCK_NAMEr�metar�_get_credentialsrr)�clientr
rr	rr�
serializer�	s3_clientr
r
r�#_initialize_crt_transfer_primativesLs
�rc	Cs2t�$tdkr$t||�\}}|a|aW5QRXtS�N)�CLIENT_CREATION_LOCK�
CRT_S3_CLIENTr�BOTOCORE_CRT_SERIALIZER)rr
rrr
r
r�get_crt_s3_client_s�r!c@seZdZdZdd�ZdS)ra�
    This wrapper keeps track of our underlying CRT client, the lock used to
    acquire it and the region we've used to instantiate the client.

    Due to limitations in the existing CRT interfaces, we can only make calls
    in a single region and does not support redirects. We track the region to
    ensure we don't use the CRT client when a successful request cannot be made.
    cCs||_||_||_||_dSr)�
crt_client�process_lockrr)�selfr"r#rrr
r
r�__init__xszCRTS3Client.__init__N)�__name__�
__module__�__qualname__�__doc__r%r
r
r
rrns	rcCsF|dkrdS|��}|dkr dSt|��|j�}|jj|jk}|oD|S)z�
    Boto3 client must use same signing region and credentials
    as the CRT_S3_CLIENT singleton. Otherwise fallback to classic.
    NF)r�compare_identityZget_frozen_credentialsrrrr)r�
crt_s3_client�boto3_credsZis_same_identityZis_same_regionr
r
r�is_crt_compatible_requests�r-cCsNz
|�}Wntjjk
r$YdSX|j|jkoH|j|jkoH|j|jk}|S)NF)	�botocore�
exceptionsZNoCredentialsErrorZ
access_keyZ
access_key_idZ
secret_keyZsecret_access_key�tokenZ
session_token)r,Zcrt_s3_credsZ	crt_credsZis_matching_identityr
r
rr*�s

�
�r*cCs$t||�}t||�r t|jt�SdS)z8Create a CRTTransferManager for optimized data transfer.N)r!r-rr"r )rr
r+r
r
r�create_crt_transfer_manager�s

�r1)r)�	threadingZbotocore.exceptionsr.Zbotocore.sessionrZs3transfer.crtrrrrrrr �Lockrrrrrrr!rr-r*r1r
r
r
r�<module>
s"		

F1le Man4ger