HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyc
�
1�3\c@@s?ddlmZddlZddlmZddlmZmZmZm	Z	m
ZmZm
Z
mZddlmZd�Zdd	hZd
dhZd�Zd
�Zdefd��YZdefd��YZd�Zd�Zd�Zd�Zd�Zd�Zied6ed6ed6ed6ed6ed6ZdS(i(tabsolute_importNi(t_(tencodingterrortpycompattsslutilturltutiltwireprotoframingtwireprototypes(tcborutilcC@sdg}xN|D]F}t|d�}d|krF|t|d�}n|j|�q
Wdj|�S(s4Format an encoded message from the framing protocol.tmsgtargst(Rttupletappendtjoin(tatomstchunkstatomR((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pytformatrichmessages
thttpthttpstsha1tsha256cC@s=|jd�tkrF|jtd�|d|jdd�f�tS|jd�r~tjr~|jtd�|d�tSd|krt|d�}t�}x7tjD],}|j	d�s�t
�|j|d	�q�W||@s|jtd
�|ddjt
|��f�tSn|jtd�|d�tS(
s�Determine whether a redirect target entry is supported.

    ``target`` should come from the capabilities data structure emitted by
    the server.
    tprotocols:(remote redirect target %s uses unsupported protocol: %s)
tnameR
tsnirequireds8(redirect target %s requires SNI, which is unsupported)
ttlsversionsttlsisB(remote redirect target %s requires unsupported TLS versions: %s)
s, s*(remote redirect target %s is compatible)
(tgettSUPPORTED_REDIRECT_PROTOCOLStnoteRtFalseRthassnitsettsupportedprotocolst
startswithtAssertionErrortaddRtsortedtTrue(tuittargetRt	supportedtv((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pytredirecttargetsupported4s(	
!cC@s�|sd|krdSg|ddD]}t||�r&|d^q&}g|ddD]}|tkrZ|^qZ}i|d6|d6S(spResolve the "redirect" command request key given an API descriptor.

    Given an API descriptor returned by the server, returns a data structure
    that can be used in hte "redirect" field of command requests to advertise
    support for compatible redirect targets.

    Returns None if no redirect targets are remotely advertised or if none are
    supported.
    tredirectttargetsRthashesN(tNoneR.tSUPPORTED_CONTENT_HASHES(R*t
apidescriptorttR0thR1((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pytsupportedredirectsVs
tcommandresponsecB@sGeZdZed�Zd�Zd�Zd�Zd�Zd�Z	RS(s�Represents the response to a command request.

    Instances track the state of the command and hold its results.

    An external entity is required to update the state of the object when
    events occur.
    cC@sy||_||_||_t|_tj�|_tj�|_	g|_
d|_t
j�|_t|_d|_dS(N(t	requestidtcommandtfromredirectR!t_inputcompletet	threadingtRLockt_locktEventt_serviceablet_pendingeventsR2t
_pendingerrorR
tbufferingdecodert_decodert_seeninitialt	_redirect(tselfR9R:R;((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyt__init__ws							cC@s*|j�t|_|jj�WdQXdS(N(R?R)R<RAR#(RH((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyt_oninputcomplete�s
	cC@s�|jj|�\}}}|s%dS|j��xo|jj�D]^}|jrl|jrl|j|�q?n|jr�tj	t
d���n|jj|�q?W|j
j�WdQXdS(NsMreceived unexpected response data after content redirect; the remote is buggy(REtdecodeR?tgetavailableRFR;t_handleinitialRGRtAbortRRBRRAR#(RHtdatat	availablet	readcounttwantedto((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyt_onresponsedata�s

	cC@s*||_|j�|jj�WdQXdS(N(RCR?RAR#(RHte((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyt_onerror�s	
cC@st|_|ddkrdS|ddkr�|d}tjd|dd|dd|jd�d|jd�d	|jd	�d
|jd
�d|jd��|_dSi|dd
d6g}d|dkr�|dd|dd<ntjt|���dS(NtstatustokR/tlocationRt	mediatypetsizet
fullhashestfullhashseedtserverdercertstservercadercertsRtmessageRRi(	R)RFR	talternatelocationresponseRRGRt	RepoErrorR(RHRStlR((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyRM�s$	
	

cc@s�x�tr�|jjd�|jr.|j�n|j�4|jj�|j}t|j�}g|j(WdQXx|D]}|VqtW|rPqqWdS(s�Obtained decoded objects from this response.

        This is a generator of data structures that were decoded from the
        command response.

        Obtaining the next member of the generator may block due to waiting
        on external data to become available.

        If the server encountered an error in the middle of serving the data
        or if another error occurred, an exception may be raised when
        advancing the generator.
        g�?N(	R)RAtwaitRCR?tclearR<tlistRB(RHtstoptpendingRS((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pytobjects�s
		

	
	(
t__name__t
__module__t__doc__R!RIRJRTRVRMRi(((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyR8ns				t
clienthandlercB@seeZdZd	ejjd�Zd	d�Zd�Z	d�Z
d�Zd�Zd�Z
d�ZRS(
s�Object to handle higher-level client activities.

    The ``clientreactor`` is used to hold low-level state about the frame-based
    protocol, such as which requests and streams are active. This type is used
    for higher-level operations, such as reading frames from a socket, exposing
    and managing a higher-level primitive for representing command responses,
    etc. This class is what peers should probably use to bridge wire activity
    with the higher-level peer API.
    cC@sd||_||_i|_i|_i|_g|_t|_|pQtj	|�|_
||_dS(N(t_uit_reactort	_requestst_futurest
_responsest
_redirectsR!t
_frameseofturlmodtopenert_openert_requestbuilder(RHR*t
clientreactorRvtrequestbuilder((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyRI�s							c	C@s�|jj||d|�\}}}|dkrFtjd|��n|j}||j|<||j|<t||�|j|<t	d�S(sxRegister a request to call a command.

        Returns an iterable of frames that should be sent over the wire.
        R/tnoops%s not yet supported((
RotcallcommandRtProgrammingErrorR9RpRqR8Rrtiter(	RHR:RtfR/trequesttactiontmetatrid((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyR|s	

cC@s?|jj�\}}|dkr7tjd|��n|dS(smFlush all queued commands.

        Returns an iterable of frames that should be sent over the wire.
        t
sendframess%s not yet supportedtframegen(Rot
flushcommandsRR}(RHR�R�((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyR�scC@s�|jsZtj|�}|dkr0t|_qZ|jjtd�|�|j|�n|j	r�|j
|j	d�s�|j	jd�q�n|jr�|j	r�dStS(s�Attempt to read data and do work.

        Returns None if no data was read. Presumably this means we're
        done with all read I/O.
        sreceived %r
iN(RtRt	readframeR2R)RnR Rt
_processframeRst_processredirecttpop(RHtframefhtframe((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pytreaddata's		cC@s�|jj|�\}}|dkr�tj|d�}|j|jkr`|j|jj�n|j|jkr�|j|jj|�|j|j=n|�dS|dkr�dS|dkr�ntj	d|��|j|j
kr�tj	d|��n|j|j}|dkr�y|j|||�Wq�tk
r�}|j|jkr�|j|jj|�|j|j=|j�q�|j
|�q�Xntj	d|��dS(	sProcess a single read frame.RR`NR{tresponsedatasaction not handled: %ss�received frame for unknown request; this is either a bug in the clientreactor not screening for this or this instance was never told about this request: %rs'unhandled action from clientreactor: %s(RotonframerecvRRbR9RrRJRqt
set_exceptionR}Rpt_processresponsedatat
BaseExceptionRV(RHR�R�R�RUtresponse((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyR�@s>


cC@s|j|d�|dr5|j�|j|j=n
|jsBdS|jre|j|j|j�dS|j|jkr{dS|jt	kr�|j|jj
|j��|j|j=nI|jrt	|j|j��}|j|jj
|�|j|j=ndS(NROteos(
RTRJRpR9RFRGt_followredirectRqR:tCOMMAND_DECODERSt
set_resultRiR<(RHR�R�R�tdecoded((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyR�xs$

			cC@s�|jjtd�|j�|jdkrKtjtd�|j��n|jrm|jjtd��n|j	s|j
r�|jjtd��ni|jd6}|jtj
|j�d|�}y|jj|�}Wn�tjjk
r$}|jdkrtjtd���n�nOtjjk
rr}|jjd	|j��|jj�td|��nXtj|�|j|}t||jd
t �|j|<|j!j"||f�dS(s4Called to initiate redirect following for a request.s(following redirect to %s)
sapplication/mercurial-cbors-cannot handle redirects for the %s media typesC(support for validating hashes on content redirects not supported)
sM(support for pinning server certificates on content redirects not supported)
tAccepti�sauthorization failedshttp error requesting %s
R;N(#RnR RRRZRRNR\twarnR^R_RxRtstrurlR2RwtopenRturlerrt	httperrortcodethttplibt
HTTPExceptiontdebugtget_full_urlt	tracebacktIOErrorRutwrapresponseRrR8R:R)RsR(RHR9R/theaderstreqtresRUtoldresponse((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyR��s6	
!


	cC@s|j|}y�|jd�}|j|�|s?|j�n||jkrXt|�S|jtkr�|j|j|j	��|j|=nC|j
r�t|j|j	��}|j|j|�|j|=nt|�SWn<tk
r}|j|j|�|j|=|j�t
SXdS(s�Called to continue processing a response from a redirect.

        Returns a bool indicating if the redirect is still serviceable.
        i�N(RrtreadRTRJRqtboolR:R�R�RiR<R�R�R!(RHR�R�R�ROR�RU((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyR��s*




	


N(RjRkRlR2RturlreqR�RIR|R�R�R�R�R�R�(((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyRm�s				8	,	-cC@s t|�}d�|j�D�S(NcS@s(i|]\}}|tj|��qS((Rttolocal(t.0tkR-((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pys
<dictcomp>�s	(tnexttitems(tobjstbm((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pytdecodebranchmap�scC@s
t|�S(N(R�(R�((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pytdecodeheads�scC@s5t|�}g|D]}|dkr+tnt^qS(Nt1(R�R)R!(R�trawtc((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pytdecodeknown�scC@s
t|�S(N(R�(R�((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pytdecodelistkeysscC@s
t|�S(N(R�(R�((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pytdecodelookupscC@s
t|�S(N(R�(R�((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyt
decodepushkey
st	branchmaptheadstknowntlistkeystlookuptpushkey( t
__future__RR=ti18nRR
RRRRRRuRRR	tutilsR
RRR3R.R7tobjectR8RmR�R�R�R�R�R�R�(((s?/usr/lib64/python2.7/site-packages/mercurial/wireprotov2peer.pyt<module>s6:
				"	��