HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //lib/python3.6/site-packages/S3/__pycache__/Custom_httplib27.cpython-36.opt-1.pyc
3

�9pe��@sddlmZmZddlZddlZddlmZmZmZmZm	Z	m
Z
mZmZm
Z
mZyddlmZWn ek
r�ddlmZYnXddlmZddd	gZd
d�Zdd
�Zdd�Zddd�ZdZddd�ZGdd�de�Zdd�Zeej_eej_ eej_!eej_"eej_#eej_$dS)�)�absolute_import�print_functionN)
�_CS_REQ_SENT�_CS_REQ_STARTED�CONTINUE�UnknownProtocol�CannotSendHeader�
NO_CONTENT�NOT_MODIFIED�EXPECTATION_FAILED�HTTPMessage�
HTTPException)�StringIO�)�encode_to_s3ZPATCHZPOSTZPUTcCs�|jdk	rdS|j�\}}}||_|j�|_|dkr<d|_n*|jd�rNd|_n|dkr^d|_nt|��|jdkr�d|_d|_	d	|_
tt��|_dSt|j
d�|_|jdkr�x|jjD]}td
|dd�q�Wd|j_
|jjd
�}|r�|j�dkr�d	|_	d|_nd|_	|j�|_
|jjd�}|�rh|j	�rhyt|�|_Wntk
�rRd|_YnX|jdk�rnd|_nd|_|tk�s�|tk�s�d|k�o�dkn�s�|jdk�r�d|_|j
�r�|j	�r�|jdk�r�d	|_
dS)z� Re-implemented httplib begin function
    to not loop over "100 CONTINUE" status replies
    but to report it to higher level so it can be processed.
    NzHTTP/1.0�
zHTTP/1.�zHTTP/0.9�	rrzheader:� )�endztransfer-encoding�chunkedzcontent-length�d��ZHEAD)�msgZ_read_status�status�strip�reason�version�
startswithr�lengthrZ
will_closerr�fp�
debuglevel�headers�printZ	getheader�lowerZ
chunk_leftZ_check_close�int�
ValueErrorr	r
�_method)�selfrrr�hdrZtr_encr�r*�&/usr/lib/python3.6/Custom_httplib27.py�httpresponse_patched_begins\







r,cCs�d}|dkr|j�tkrd}nv|dk	r�ytt|��}Wn\ttfk
r�yttj|j��j	�}Wn*tt
fk
r�|jdkr�td�YnXYnX|dk	r�|j
d|�dS)N�0rz
Cannot stat!!zContent-Length)�upper�_METHODS_EXPECTING_BODY�str�len�	TypeError�AttributeError�os�fstat�fileno�st_size�OSErrorr!r#�	putheader)r(�body�methodZthelenr*r*r+�)httpconnection_patched_set_content_lengthgs
r<cCs,tjdd�|D��}i}d|kr(d|d<d|kr8d|d<d}x0|j�D]$\}}	d	|j�krFd
|	j�krFd}qFWt|�}|j||f|�d|kr�|j||�x(|j�D]\}}	|jt|�t|	��q�W|s�|j|�nT|s�t	d
��|j�|j
�}
|
j�t|_
|
jtk�rt��n|
jtk�r(|j|�dS)NcSsg|]}|j��qSr*)r$)�.0�kr*r*r+�
<listcomp>�sz7httpconnection_patched_send_request.<locals>.<listcomp>�hostrZ	skip_hostzaccept-encodingZskip_accept_encodingF�expectz100-continueTzcontent-lengthz.A body is required when expecting 100-continue)�dict�fromkeysZ	iteritemsr$rZ
putrequest�_set_content_lengthr9�
endheadersr
Zgetresponse�readr�_HTTPConnection__staterr�ExpectationFailedr�send)r(r;Zurlr:r"Zheader_namesZskipsZexpect_continuer)�valueZrespr*r*r+�#httpconnection_patched_send_requests8rKcCs&|jtkrt|_nt��|j|�dS)aoIndicate that the last header line has been sent to the server.

    This method sends the request to the server.  The optional
    message_body argument can be used to pass a message body
    associated with the request.  The message body will be sent in
    the same packet as the message headers if it is string, otherwise it is
    sent as a separate packet.
    N)rGrrr�_send_output)r(�message_bodyr*r*r+�!httpconnection_patched_endheaders�s	
rNi@cCsn|jjd�dj|j�}|jdd�=t|�}t|t�rNt|�tkrN||7}d}|j|�|dk	rj|j|�dS)z�Send the currently buffered request and clear the buffer.

    Appends an extra \r\n to the buffer.
    A message_body may be specified, to be appended to the request.
    �s
N)rOrO)	Z_buffer�extend�joinr�
isinstancer0r1�mssrI)r(rMrr*r*r+�"httpconnection_patched_send_output�s
rTc@seZdZdS)rHN)�__name__�
__module__�__qualname__r*r*r*r+rH�srHcCs|j|�dS)N)rI)r(rMr*r*r+�(httpconnection_patched_wrapper_send_body�srX)N)N)%Z
__future__rrr4Zhttplibrrrrrr	r
rrr
Z	cStringIOr�ImportErrorZ	BaseUtilsrr/r,r<rKrNrSrTrHrXZHTTPResponseZbeginZHTTPConnectionrErLrDZ
_send_requestZwrapper_send_bodyr*r*r*r+�<module>s.0
N(