HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/CyberPanel/lib64/python3.10/site-packages/botocore/__pycache__/compress.cpython-310.pyc
o

�hN�@s�dZddlZddlZddlmZddlmZddlmZddl	m
Z
e�e�Z
dd�Zd	d
�Zdd�Zd
d�Zdd�Zdd�Zdd�ZdeiZdS)z�
NOTE: All functions in this module are considered private and are
subject to abrupt breaking changes. Please do not use them directly.

�N)�GzipFile)�compress)�	urlencode)�determine_content_lengthcCsrt|||�r5|jdD]+}t�|�}|dur.t�d|�||d�|d<t|d|�dSt�d|�qdSdS)zAAttempt to compress the request body using the modeled encodings.�	encodingsNz%Compressing request with %s encoding.�body�headersz$Unsupported compression encoding: %s)�_should_compress_request�request_compression�COMPRESSION_MAPPING�get�logger�debug�_set_compression_header)�config�request_dict�operation_model�encoding�encoder�r�G/usr/local/CyberPanel/lib/python3.10/site-packages/botocore/compress.py�maybe_compress_requests
�rc	Cs�|jdur>|jdkr>|jdur>t|�s#t|d�}d}t�||�dS|jr1|��}|j	}d|vSt
|d�}|j}||kSdS)NT�v2rz*Body type %s does not support compression.F�requiresLength)�disable_request_compression�signature_versionr
�_is_compressible_type�typer
r�has_streaming_input�get_streaming_input�metadata�_get_body_size�"request_min_compression_size_bytes)	rrr�	body_type�log_msg�streaming_input�streaming_metadata�	body_size�min_sizerrrr	,s 


r	cCsL|d}t|t�rt|ddd��d�}||d<t|tttf�}|p%t|d�S)NrT�utf-8)�doseqr�read)�
isinstance�dictr�encode�str�bytes�	bytearray�hasattr)rr�is_supported_typerrrrDs
rcCs$t|�}|durt�d|�d}|S)NzCUnable to get length of the request body: %s. Skipping compression.r)rr
r)r�sizerrrr!Ns�r!cCsvt|t�rt|�d��St|ttf�rt|�St|d�r9t|d�r5t|d�r5|��}t|�}|�	|�|St|�SdS)Nr)r+�seek�tell)
r,r/�
gzip_compressr.r0r1r2r6�_gzip_compress_fileobjr5)r�current_position�compressed_objrrr�_gzip_compress_bodyZs


�r;cCstt��}t|dd��!}	|�d�}|snt|t�r|�d�}|�|�qWd�n1s.wY|�d�|S)N�wb)�fileobj�modeTi r)r)	�io�BytesIOrr+r,r/r.�writer5)rr:�gz�chunkrrrr8hs



��
r8cCs4|�d�}|dur||d<dS|�d|��|d<dS)NzContent-Encoding�,)r)rr�	ce_headerrrrrvs
r�gzip)�__doc__r?�loggingrFrrr7�botocore.compatr�botocore.utilsr�	getLogger�__name__r
rr	rr!r;r8rrrrrr�<module>s