403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib64/python3.9/site-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/mercurial/__pycache__/httppeer.cpython-39.opt-1.pyc
a

�+�b�R�@s(ddlmZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZm
Z
mZm	Z	mZmZmZmZddlmZejZejZejZdd	�ZGd
d�de�Zdd
�Zdd�Zdd�ZGdd�de
j�Z dd�Z!Gdd�dej"�Z#Gdd�de	j$j%�Z&dd�Z'dej(fdd�Z)d dd�Z*dS)!�)�absolute_importN�)�_)�getattr)�bundle2�error�httpconnection�pycompat�statichttprepo�url�util�wireprotov1peer)�urlutilc
Cszt�|�d}|t|d�td�}g}d}t�dt|�|�D]4}|d7}|�|t|�t�||||��f�q@|S)acEncode a string value into multiple HTTP headers.

    ``value`` will be encoded into 1 or more HTTP headers with the names
    ``header-<N>`` where ``<N>`` is an integer starting at 1. Each header
    name + value will be at most ``limit`` bytes long.

    Returns an iterable of 2-tuples consisting of header names and
    values as native strings.
    z-%sZ000s: 
rr)r	�strurl�lenZxrange�append�str)�value�header�limitZfmtZvaluelen�result�n�i�r�8/usr/lib64/python3.9/site-packages/mercurial/httppeer.py�encodevalueinheaders$s*rc@s8eZdZdd�Zedd��Zd
dd�Zejfdd	�Z	dS)�
_multifilecGs6|D] }t�|d�stdt|�|��q||_d|_dS)N�lengthsO_multifile only supports file objects that have a length but this one does not:r)r�safehasattr�
ValueError�type�	_fileobjs�_index)�selfZfileobjs�frrr�__init__Bs�z_multifile.__init__cCstdd�|jD��S)Ncss|]}|jVqdS�N)�length��.0r$rrr�	<genexpr>P�z$_multifile.length.<locals>.<genexpr>)�sumr!�r#rrrr'Nsz_multifile.lengthNcCs�|dkrd�dd�|jD��Sg}|rz|jt|j�krz|�|j|j�|��t|d�}||krp|jd7_||8}q"d�|�S)Nrr+css|]}|��VqdSr&)�readr(rrrr*Tr+z"_multifile.read.<locals>.<genexpr>���r)�joinr!r"rrr.)r#Zamt�partsZgotrrrr.Rs
z_multifile.readcCsB|tjkrtd��|dkr"td��|jD]}|�d�q(d|_dS)NsP_multifile does not support anything other than os.SEEK_SET for whence on seek()rsQ_multifile only supports seeking to start, but that could be fixed if you need it)�os�SEEK_SET�NotImplementedErrorr!�seekr")r#�offset�whencer$rrrr5^s
��
z_multifile.seek)N)
�__name__�
__module__�__qualname__r%�propertyr'r.r2r3r5rrrrrAs


rcCs�|dkrd|d<|�dd�}|�di�}|�d|�d|fg}	d}
|duoRd	|v}|r�|r�t�t|����}|sx|}n@t|t�r�t�	|�}
t
|�|
_|
}t�	|�}t
|�|_t||�}t
|�|d
<nt|�r:|d�}|r�t
|�dd
�d�}
|
dk�r*t�t|����}t|d|
�D]\}}|||<�qn|	t|���7}	dt�|	�}d||f}d}t�|d��rn|j}n|du�r�t
|�}|du�r�d|v�r�d|d<t�}t�}|du�r�|d�}|�r�|�d�t|�d��}|�d�d|v�r�|�d�d|v�r6|d��r6dd�tj�tj�D�}|�dd�|��|�rptd�t|��d|
�pTd�}|D]\}}|||<�q\g}|D] }|���d ��rx|�|��qx|�r�d!�t|��|d"<|t�|�||�}|du�r�|�d#|�|�d$d%|�|||fS)&aWMake an HTTP request to run a command for a version 1 client.

    ``caps`` is a set of known server capabilities. The value may be
    None if capabilities are not yet known.

    ``capablefn`` is a function to evaluate a capability.

    ``cmd``, ``args``, and ``data`` define the command, its arguments, and
    raw data to pass to it.
    spushkeyr+sdataNsheadersssending %s command
scmdr�httppostargsz
X-HgArgs-Posts
httpheader�,rsX-HgArgs?%ss%s%sr�Content-Type�application/mercurial-0.1s
httpmediatypes0.1spartial-pulls0.2txs0.2scompressioncSsg|]}|��j�qSr)Zwireprotosupport�name)r)�errr�
<listcomp>�s�z(makev1commandrequest.<locals>.<listcomp>scomp=%s� s	X-HgProto�zx-hg�,ZVaryssending %d bytes
zContent-Lengthz%d)�pop�debug�urlreq�	urlencode�sorted�items�
isinstance�bytes�io�BytesIOrr'r�int�splitrrr�set�add�compenginesZsupportedwireenginesZ
CLIENTROLEr0�lower�
startswithrr	rZadd_unredirected_header)�ui�requestbuilder�capsZ	capablefnZrepobaseurl�cmd�args�data�headers�qZ
headersizeZ
postargsokZstrargsrZargsioZ
httpheaderZencoded_argsrr�qs�cu�sizeZprotoparamsZ
mediatypes�mt�compsZprotoheadersZvaryheaders�reqrrr�makev1commandrequestns�








�





��
recCs tjr|jS|��sdS|��S)z3Get request data, if any. If no data, returns None.N)r	Zispy3r\Zhas_data�get_data)rdrrr�_reqdata�s
rgc
CsN|j}|j�r|�dd��rd}||dt�|���t�|���f�d}t|���D]T\}}t�|�}t�|�}|�	d�r�|dur�d}|t
|�7}qX||d||f�qX|dur�||d	|�t|�}|du�rt|d
d�}	|	dur�t
|�}	||d|	�t
��}
d}z�z|�|�}Wn�tj�yd}z(|jdk�rNt�td
����WYd}~nZd}~0tj�y�}z6|�dt�|����|��td|��WYd}~n
d}~00W|j�r@|�dd��r@|�r�|jnd}
||dt
��|
|
f�nD|j�r>|�dd��r>|�r|jnd}
||dt
��|
|
f�0t�|�|S)zDSend a prepared HTTP request.

    Returns the response object.
    sdevelsdebug.peer-requestsdevel-peer-request: %s
s%s %sNsX-hgarg-rs  %s %ss+  %d bytes of commands arguments in headersr's  %d bytes of datai�sauthorization failedshttp error requesting %s
r/s  finished in %.4f seconds (%d))rGZ	debugflagZ
configboolr	�bytesurlZ
get_methodZget_full_urlrJZheader_itemsrVrrgrrZtimer�open�urlerr�	httperror�coder�Abortr�httplibZ
HTTPExceptionr�hidepassword�	traceback�IOError�urlmodZwrapresponse)rW�openerrdZdbg�lineZ
hgargssizerrr\r'�start�res�instrlrrr�sendrequest�s�����


���
��"�������
rxcseZdZ�fdd�Z�ZS)�RedirectedRepoErrorcstt|��|�||_dSr&)�superryr%�respurl)r#�msgr{��	__class__rrr%<szRedirectedRepoError.__init__)r8r9r:r%�
__classcell__rrr}rry;sryc	Csd}t�|���}|�|�r4|dt|��}d}nd}|�d�|�d�krhd}|jsh|�td�|�zt�|�	dd��}	Wn&t
y�t�|j�dd��}	Yn0t
�|�}
|	�d�r�t�|����|	�d��s&|�d	t
�|��td
�|
|	p�d|�d�f}|�r|�rt||��n
t�|��z,|	�d
d�d}tdd�|�d�D��}
Wn*t�y|t�td�|
|	f��Yn0|
dk�r�|�r�tjd�|�}n\|
dk�r�t�dt�|d��d}t�||�}tj�|�}|�|�}nt�td�|
|f��||	|fS)NFT�/sreal URL is %s
zcontent-type�sapplication/hg-error�application/mercurial-srequested URL: '%s'
sI'%s' does not appear to be an hg repository:
---%%<--- (%s)
%s
---%%<---
sno content-typerD�-rcSsg|]}t|��qSr)rP)r)rrrrrBlr+z*parsev1commandresponse.<locals>.<listcomp>�.s+'%s' sent a broken Content-Type header (%s))rrszlib)r��Brs'%s' uses newer protocol %s) r	rh�geturl�endswithr�rstrip�quiet�warnrZ	getheader�AttributeErrorr]�getrrorVrZOutOfBandErrorr.rGry�	RepoErrorrQ�tuplerrrTZdecompressorreader�struct�unpackZreadexactlyZforwiretype)rWZbaseurl�requrlr_�resp�compressibleZ
redirectedr{Z	qsdropped�protoZsafeurlr|Zsubtype�version_info�elenZenameZenginerrr�parsev1commandresponseAs\


��
�


�r�c@s~eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
ddd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS) �httppeercCs:||_||_||_||_|duo&d|v|_||_||_dS)Nr<)rW�_path�_url�_capsZlimitedarguments�
_urlopener�_requestbuilder)r#rW�pathrrsrXrYrrrr%�szhttppeer.__init__cCs,|jjD]}|��t|ddd���qdS)NZ	close_allcSsdSr&rrrrr�<lambda>�r+z"httppeer.__del__.<locals>.<lambda>)r��handlers�closer)r#�hrrr�__del__�szhttppeer.__del__cCs|jSr&)r�r-rrrr�szhttppeer.urlcCsdSr&rr-rrr�local�szhttppeer.localcCs|Sr&rr-rrr�peer�sz
httppeer.peercCsdS)NTrr-rrr�canpush�szhttppeer.canpushcCsTz |jj|jj|jj}}}Wnty4YdS0|j�td�|||f�dS)NsE(sent %d HTTP requests and %d bytes; received %d bytes in responses)
)r�Z
requestscountZsentbytescountZreceivedbytescountr�rW�noter)r#Zreqs�sentZrecvrrrr��s����zhttppeer.closecCs|jSr&)r�r-rrr�capabilities�szhttppeer.capabilitiesFc	Ks`t�|�}t|j|j|j|j|j||�\}}}t|j|j	|�}t
|j|j||||�\|_}}|Sr&)r	ZbyteskwargsrerWr�r��capabler�rxr�r�)	r#rZ�
_compressibler[rdr`r_r��ctrrr�_callstream�s
�

�zhttppeer._callstreamcKs4|j|fi|��}z|��W|��S|��0dSr&)r�r.r�)r#rZr[�fprrr�_call�s�zhttppeer._callc

Ks�|�d�}z|�d�}Wnty0dg}Yn0|D]}|tjvr6|}qNq6t�|j|d|�}t�|j|d�}ddi}	z�zZ|j	|f||	d�|��}
|
�dd	�}t
|�d
kr�t�t
d�|
��|WW|��t�|�Stjy��Ynhtj�yP}zL|jdtjtjfv�r,t�t
d
�|jd	��t�|jd	��WYd}~n
d}~00W|��t�|�n|��t�|�0dS)Nsunbundler=r+�rbr>r?�r\r]�
rr�sunexpected response:rspush failed: %s)r�rQr�rZbundletypesZwritebundlerWr�httpsendfiler�rrZ
ResponseErrorrr�r2�unlinkrjrk�socketr[�errnoZ
ECONNRESETZEPIPErm)
r#rZZcgr[�types�xr Ztempnamer�r]�rZvals�errrrr�	_callpush�s>


�(�zhttppeer._callpushc
	Ks�d}z�tjddd�\}}t�|d��4}|�d�}|rJ|�|�|�d�}q0Wd�n1s^0Yt�|j|d��D}ddi}	|j	|f||	d	�|��Wd�W|dur�t�
|�S1s�0YW|dur�t�
|�n|du�r�t�
|�0dS)
Ns
hg-bundle-s.hg)�prefix�suffix�wbir�r>r?r�)r	Zmkstempr2�fdopenr.�writerr�rWr�r�)
r#rZr�r[�filename�fdZfh�dZfp_r]rrr�_calltwowaystreams$

*&
��
zhttppeer._calltwowaystreamcKs|j|fddi|��S)Nr�T)r�)r#rZr[rrr�_callcompressableszhttppeer._callcompressablecCs|�dSr&r)r#�	exceptionrrr�_abortszhttppeer._abortN)F)r8r9r:r%r�rr�r�r�r�r�r�r�r�r�r�r�rrrrr��s	
(r�c@seZdZdZddd�ZdS)�queuedcommandfuturez@Wraps result() on command futures to trigger submission on call.NcCs,|��rtjj�||�S|j��|�|�Sr&)Zdoner	�futures�FuturerZ
_peerexecutorZsendcommands)r#�timeoutrrrr s
zqueuedcommandfuture.result)N)r8r9r:�__doc__rrrrrr�sr�cCsd}dd�}i}t|||||d|�\}}}	t|||�}
zt||||	|
dd�\}}}
Wnfty�}
zNt|||||
jd|�\}}}	t|||�}
t||||	|
dd�\}}}
WYd}
~
n
d}
~
00z|
��}W|
��n
|
��0|�d�s�t�	d|��dt
|���i}||fS)	NcSst�d��dS)Nsshould not be called)r�ProgrammingError)r�rrrr�0sz!performhandshake.<locals>.capablescapabilitiesF)r�r�sunexpected content-type: %s�v1capabilities)rerxr�ryr{r.r�rVrr�rRrQ)rWrrsrXrYr�r[rdr�r_r�r{r�rAZrawdata�inforrr�performhandshake+s4�
��
�"

r�c	Cs�t�|�}|js|jr0t�td�|jp*|j��|��\}}|�d|�|pXt	�
||�}t||||�\}}t||||||d�S)a-Construct an appropriate HTTP peer instance.

    ``opener`` is an ``url.opener`` that should be used to establish
    connections, perform HTTP requests.

    ``requestbuilder`` is the type used for constructing HTTP requests.
    It exists as an argument so extensions can override the default.
    sunsupported URL component: "%s"s	using %s
r�)
rr�query�fragmentrrmr�authinforGrrrsr�r�)	rWr�rsrX�urr�r{r�rrr�makepeer`s	
��r�cCs�|rt�td���z.|�d�r2tjs2t�td���t||�}|WStjy�}zXz2t�	|d||�}|�
td��|WWYd}~Stjy�|�Yn0WYd}~n
d}~00dS)Ns!cannot create new http repositoryshttps:s1Python support for SSL and HTTPS is not installedsstatic-s(falling back to static-http)
)rrmrrVrrZ	has_httpsr�r�r
�instancer�)rWr�ZcreateZintentsZ
createoptsrwZ
httpexceptionr�rrrr�|s �
r�)NN)+Z
__future__rr�rNr2r�r�Zi18nrr	rr�rrrr
rrrrr
ZutilsrrnrjrHr�objectrrergrxr�ryr�Zwirepeerr�r�r�r�r�Zrequestr�r�rrrr�<module>	s2(
-|	HG5

Youez - 2016 - github.com/yon3zu
LinuXploit