KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache
System : Linux cs317.bluehost.com 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : andertr9 ( 1047)
PHP Version : 8.2.18
Disable Function : NONE
Directory :  /lib64/python2.7/site-packages/mercurial/hgweb/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib64/python2.7/site-packages/mercurial/hgweb/server.pyc
�
Hq�Qc@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	m
Z
ddlmZddl
mZd�Zdefd��YZdejfd	��YZd
efd��YZdefd
��YZy$ddlmZe�ejZWnEek
ree	jed�rLejZqfdefd��YZnXd�Zdeeejfd��YZdefd��YZ d�Z!dS(i����N(tutilterror(tcommon(t_cCsGd|kr'|jdd�\}}n
|d}}tj|�|fS(s�Return path and query that has been split from uri

    Just like CGI environment, the path is unquoted, the query is
    not.
    t?it(tsplitturllibtunquote(turitpathtquery((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyt	_splitURIs
t
_error_loggercBs,eZd�Zd�Zd�Zd�ZRS(cCs
||_dS(N(thandler(tselfR((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyt__init__scCsdS(N((R((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pytflushscCs|j|jd��dS(Ns
(t
writelinesR(Rtstr((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pytwritescCs(x!|D]}|jjd|�qWdS(Ns
HG error:  %s(Rt	log_error(Rtseqtmsg((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyR!s
(t__name__t
__module__RRRR(((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyR
s			t_httprequesthandlercBs�eZdZed��Zd�Zd�Zd�Zd�Zddd�Z	d�Z
d	�Zd
�Zd�Z
d�Zdd
�Zd�Zd�ZRS(thttpcCsdS(s*Prepare .socket of new HTTPServer instanceN((t
httpservertssl_cert((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pytpreparehttpserver)scOs#d|_tjj|||�dS(NsHTTP/1.1(tprotocol_versiontBaseHTTPServertBaseHTTPRequestHandlerR(Rtargstkargs((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyR.s	cGs9|jd|jd|j�||f�|j�dS(Ns%s - - [%s] %s
i(Rtclient_addresstlog_date_time_stringR(RtfptformatR"((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyt_log_any2s	cGs|j|jj||�dS(N(R(tserverterrorlog(RR'R"((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyR8scGs|j|jj||�dS(N(R(R)t	accesslog(RR'R"((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pytlog_message;st-c
Cs�g|jj�D]}|djd�r|^q}|jd|jt|�t|�djgt|�D]}d|^qi��dS(Nisx-s"%s" %s %s%sRs %s:%s(theaderstitemst
startswithR,trequestlineRtjointsorted(Rtcodetsizethtxheaders((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pytlog_request>s5	cCsDy|j�Wn/tjk
r?}|dtjkr@�q@nXdS(Ni(tdo_hgwebtsocketRterrnotEPIPE(Rtinst((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pytdo_writeDs
cCswy|j�Wnbtk
rr|jdg�|jd�djtjtj���}|j	d|j
|�nXdS(Ns500 Internal Server ErrorsInternal Server ErrorRs5Exception happened during processing request '%s':
%s(R>t	Exceptiont_start_responset_writeR2t	tracebacktformat_exceptiontsystexc_infoRR
(Rttb((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pytdo_POSTKs

	cCs|j�dS(N(RG(R((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pytdo_GETUsc
Cs�t|j�\}}i}d|d<|j|d<|jj|d<t|jj�|d<|j|d<|jj|d<|t|jj�|d<|j	d	|d
<|j	d	|d<|r�||d<n|j
jdkr�|j
j
|d
<n|j
j|d
<|j
jd�}|r||d<nx�g|j
j�D]}|d!kr1|^q1D]_}d|jdd�j�}|j
j|�}|jdd�j�}|rM|||<qMqMW|j|d<d"|d<|j|d<|jdd�j�dkrtj|j|jj�|_n|j|d<t|�|d<t|jtj�|d<t|jtj �|d<d	|d <d|_!g|_"t#|_$d|_%d|_&x-|jj'||j(�D]}	|j)|	�q�W|j$s�|j*�n|j+�dS(#NsCGI/1.1tGATEWAY_INTERFACEtREQUEST_METHODtSERVER_NAMEtSERVER_PORTtREQUEST_URItSCRIPT_NAMEt	PATH_INFOitREMOTE_HOSTtREMOTE_ADDRtQUERY_STRINGtCONTENT_TYPEscontent-lengthtCONTENT_LENGTHscontent-typetHTTP_R-Rs
RtSERVER_PROTOCOLiswsgi.versionswsgi.url_schemetHTTP_EXPECTs100-continues
wsgi.inputswsgi.errorsswsgi.multithreadswsgi.multiprocesss
wsgi.run_once(scontent-typescontent-length(ii(,RR
tcommandR)tserver_nameRtserver_porttprefixtlenR$R.t
typeheadertNonettypet	getheadertkeystreplacetuppertstriptrequest_versiont
url_schemetgettlowerRtcontinuereadertrfiletwfileRR
t
isinstancetSocketServertThreadingMixIntForkingMixIntsaved_statust
saved_headerstFalsetsent_headerstlengtht_chunkedtapplicationR@RAtsend_headerst_done(
RR
RtenvRtR6theaderthkeythvaltchunk((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyR9Xs`







!
		
						
cCs1|jstd��n|jjdd�}t|d�|d<|j|�d|_t|_xJ|j	D]?}|j
|�|dj�dkrjt|d�|_qjqjW|jdkr|dtj
kr|jo�|jdk|_|jr|j
dd�q|j
dd	�n|j�t|_dS(
Ns.Sending headers before start_response() callediiscontent-lengthsHTTP/1.1sTransfer-Encodingtchunkedt
Connectiontclose(RptAssertionErrorRR^tintt
send_responseRtRrRuRqtsend_headerRhRtHTTP_NOT_MODIFIEDtclose_connectionRetend_headerstTrueRs(RRpR6((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyRw�s(	
		

	
cCsl|jdd�\}}t|�}||_d}g|D]"}|dj�|kr:|^q:|_|jS(Nit
connectionstransfer-encodingi(s
connectionstransfer-encoding(RR^R�RpRhRqRA(Rthttp_statusR.RER4Rtbad_headersR6((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyR@�s	
%cCs�|jstd��n|js.|j�n|jdk	rzt|�|jkratd��n|jt|�|_n(|jr�|r�dt|�|f}n|jj	|�|jj
�dS(Ns+data written before start_response() calledsLContent-length header sent, but more bytes than specified are being written.s%x
%s
(RpR�RsRwRtR^R\RuRkRR(Rtdata((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyRA�s		
cCs-|jr)|jjd�|jj�ndS(Ns0

(RuRkRR(R((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyRx�s	N(RRRftstaticmethodRRR(RR,R8R>RGRHR9RwR^R@RARx(((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyR%s						
		7			t_httprequesthandleropensslcBs>eZdZdZed��Zd�Zd�Zd�ZRS(s HTTPS handler based on pyOpenSSLthttpscCs�yddl}|jjWn&tk
rBtjtd���nX|jj|jj�}|j|�|j	|�t
j
|j|j�}|jj
||�|_
|j�|j�dS(Ni����sSSL support is unavailable(tOpenSSLtSSLtContexttImportErrorRtAbortRt
SSLv23_METHODtuse_privatekey_filetuse_certificate_fileR:taddress_familytsocket_typeRtserver_bindtserver_activate(RRR�tctxtsock((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyR�s



cCsL|j|_tj|jd|j�|_tj|jd|j�|_dS(Ntrbtwb(trequestR�R:t_fileobjecttrbufsizeRjtwbufsizeRk(R((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pytsetup�scCsYddl}ytj|�Wn5|jjk
rT}|jdtjkrU�qUnXdS(Ni����i(R�RR>R�tSysCallErrorR"R;R<(RR�R=((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyR>�scCsPddl}ytj|�Wn,|jj|jjfk
rKt|_nXdS(Ni����(R�Rthandle_one_requestR�R�tZeroReturnErrorR�R�(RR�((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyR��s	(	RRt__doc__RfR�RR�R>R�(((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyR��s		t_httprequesthandlersslcBs,eZdZdZed��Zd�ZRS(s=HTTPS handler based on Pythons ssl module (introduced in 2.6)R�cCsnyddl}|jWn&tk
r?tjtd���nX|j|jdtd|d|j�|_dS(Ni����sSSL support is unavailabletserver_sidetcertfiletssl_version(	tssltwrap_socketR�RR�RR:R�tPROTOCOL_SSLv23(RRR�((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyR�s
cCsL|j|_tj|jd|j�|_tj|jd|j�|_dS(NR�R�(R�R�R:R�R�RjR�Rk(R((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyR��s(RRR�RfR�RR�(((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyR��s
(tactiveCounttforkt_mixincBseZRS((RR(((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyR�	scCs#|r|dkrt|d�S|S(NR-ta(topen(topttdefault((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pytopenlogs
tMercurialHTTPServercBs)eZejdkrdZnd�ZRS(tntic	Kstjj||||�t|_||_|j||jdd��|jddd�}|rxd|jd�}n||_	t
|jddd�tj�}t
|jddd�tj
�}||_||_|jj�d	d
!\|_|_tj|d	�|_dS(NtwebtcertificateR[Rt/R+R-R*ii(R t
HTTPServerRR�tdaemon_threadsRvRtconfigRdR[R�RDtstdouttstderrR+R*R:tgetsocknametaddrtporttgetfqdntfqaddr(	RtuitappR�RtkwargsR[talogtelog((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyRs			!!		"(RRtostnametallow_reuse_addressR(((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyR�s	tIPv6HTTPServercBs#eZeedd�Zd�ZRS(tAF_INET6cOsD|jdkr'tjtd���ntt|�j||�dS(Ns$IPv6 is not available on this system(R�R^Rt	RepoErrorRtsuperR�R(RR"R�((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyR-sN(RRtgetattrR:R^R�R(((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyR�+scCs|jdd�r3tjd
kr*t}q9t}nt}|jdd�rTt}nt}ddl	}|j
�|jddd�}tj|jdd	d
��}y|||||f|�SWn?t
jk
r}tjtd�|||jdf��nXdS(NR�R�iitipv6i����taddressRR�i@s"cannot start server at '%s:%d': %si(ii(R�RDtversion_infoR�R�Rt
configboolR�R�t	mimetypestinitRtgetportR:RR�RR"(R�R�RtclsR�R�R�R=((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyt
create_server2s"			
("R�RDR;RR R:RmRBt	mercurialRRtmercurial.hgwebRtmercurial.i18nRRtobjectR
R!RR�R�t	threadingR�RnR�R�tsafehasattrRoR�R�R�R�R�(((s</usr/lib64/python2.7/site-packages/mercurial/hgweb/server.pyt<module>	s(`	�)

	

Anon7 - 2021