File: //usr/local/CyberPanel/lib64/python3.10/site-packages/botocore/__pycache__/response.cpython-310.pyc
o
�h; � @ s� d dl Z d dlmZ d dlmZ d dlmZ d dlm Z d dl
mZ d dlm
Z
mZmZ d dlmZ d d l
mZ d d
lmZ e �e�ZG dd� de�Zd
d� ZdS )� N)�IOBase)�
ProtocolError)�ReadTimeoutError)�parsers)�set_socket_timeout)�IncompleteReadErrorr �ResponseStreamingError)�ScalarTypes)�
XMLParseError)�first_non_none_responsec @ s� e Zd ZdZdZdd� Zdd� Zdd� Zd d
� Zd#dd
�Z dd� Z
dd� Zdd� Zdd� Z
dd� ZeZedfdd�Zefdd�Zdd� Zdd � Zd!d"� ZdS )$�
StreamingBodyae Wrapper class for an http response body.
This provides a few additional conveniences that do not exist
in the urllib3 model:
* Set the timeout on the socket (i.e read() timeouts)
* Auto validation of content length, if the amount of bytes
we read does not match the content length, an exception
is raised.
i c C s || _ || _d| _d S )Nr )�_raw_stream�_content_length�_amount_read)�self�
raw_stream�content_length� r �G/usr/local/CyberPanel/lib/python3.10/site-packages/botocore/response.py�__init__5 s
zStreamingBody.__init__c C s d S �Nr �r r r r �__del__: s zStreamingBody.__del__c C s2 z t | j|� W dS ty tjddd� � w )z&Set the timeout seconds on the socket.zbCannot access the socket object of a streaming response. It's possible the interface has changed.T)�exc_infoN)r r
�AttributeError�logger�error)r �timeoutr r r r @ s ��z StreamingBody.set_socket_timeoutc C s"