https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/mercurial/__pycache__/httpconnection.cpython-310.pyc
o

�]Lb�@spddlmZddlZddlmZddlmZddlmZmZddl	m
Z
ejZejZGdd	�d	e
�Zd
d�ZdS)�)�absolute_importN�)�_)�open)�pycompat�util)�urlutilc@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�httpsendfilez�This is a wrapper around the objects returned by python's "open".

    Its purpose is to send file-like objects via HTTP.
    It do however not define a __len__ attribute because the length
    might be more than Py_ssize_t can handle.
    cOs\||_t|i|��|_|jj|_|jj|_|jj|_t�|j���j	|_
d|_|��|_
dS)Nr)�uir�_data�seek�close�write�os�fstat�fileno�st_size�length�_pos�
_makeprogress�	_progress)�selfr
�args�kwargs�r�:/usr/lib/python3/dist-packages/mercurial/httpconnection.py�__init__&s


zhttpsendfile.__init__cCs$|jjtd�td�|jddd�S)Nssendingskb��)�unit�total)r
�makeprogressrr�rrrrr0s�zhttpsendfile._makeprogresscOsL|jj|i|��}|s|j��|S|jt|�7_|j�|jd�|S)Nr)r�readr�completer�len�update)rrr�retrrrr#:s
zhttpsendfile.readcCs|S�Nrr"rrr�	__enter__Cszhttpsendfile.__enter__cCs|��dSr()r
)r�exc_type�exc_val�exc_tbrrr�__exit__Fszhttpsendfile.__exit__N)	�__name__�
__module__�__qualname__�__doc__rrr#r)r-rrrrr	s

	r	cCs�t�|�}i}|�d�D]2\}}|dvrqd|vr#|�td�|�q|�dd�\}}|�|i�}|dvr:t�|�}|||<q|�	dd�\}	}
d}d}d}
t�
|�D]�\}}|ra||�d	|�kraqR|�d
�}|siqRt�
|�}|jrw|j|krwqRd|_t|�}|�	dd�}t|�dkr�|dg|d}}n	|�d�p�d�	�}|d
ks�|
�|�r�t|�|ks�t|�|kr�|s�d	|vr�|	|vr�t|�}||f}
|�d	�}|r�|s�||d	<qR|
S)Nsauth)s
cookiefile�.s!ignoring invalid [auth] key '%s'
r)�usernamescertskeys://rr3sprefixsschemesshttps�*)r�bytesurl�configitems�warnr�rsplit�
setdefaultr�
expandpath�split�	iteritems�getr�url�user�bytesr%�
startswith)r
�urir?�groups�key�val�group�setting�gdict�scheme�hostpath�bestuser�bestlen�bestauth�auth�prefix�	prefixurl�p�schemesrrr�readauthforuriKs\




�
�rS)�
__future__rr�i18nrrr�r�utilsr�urlerr�urlreq�objectr	rSrrrr�<module>s
-

https://t.me/RX1948 - 2025