���� JFIF    fdasasfas213sdaf403WebShell
403Webshell
Server IP : 84.32.84.239  /  Your IP : 216.73.216.70
Web Server : LiteSpeed
System : Linux in-mum-web669.main-hosting.eu 5.14.0-503.23.2.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 12 05:52:18 EST 2025 x86_64
User : u479334040 ( 479334040)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /proc/self/root/opt/alt/python27/lib/python2.7/site-packages/redis/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/self/root/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyc
�
u�fc@s*ddlmZddlmZddlmZddlmZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z ddl!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/ddl0m1Z1yddl2Z2e3Z4Wne5k
r�e6Z4nXiej7e6Z8e4r�e9e2d	�r�d
e8e2j:<d
e8e2j;<n
d
e8e2j<<ne
j=e8krde8e
j=<ne>e8j?��Z@e1r�ddlAZAeeAjB�ZCeCed�kZDeCed
�kZEeCed�kZFeEr�deAjBZGejHeG�ne3ZIeEr�e6ZInndZJdZKdZLdZMdZNeO�ZPdeOfd��YZQdeOfd��YZRdeOfd��YZSdeRfd��YZTdeRfd��YZUe1r]eUZVneTZVdeOfd ��YZWd!eWfd"��YZXd#eWfd$��YZYd%d&d'd(d)fZZd*�Z[ie\d+6e\d,6e[d-6e[d.6e]d/6e]d06e[d16Z^d2eOfd3��YZ_d4e_fd5��YZ`dS(6i����(tunicode_literals(t
StrictVersion(tchain(ttimeN(txrangetimaptunicodetlongt	nativestrt
basestringt	iteritemst	LifoQueuetEmptytFullturlparsetparse_qstrecvt	recv_intotunquotetBlockingIOErrortsendalltshutdowntssl_wrap_socket(tAuthenticationErrort$AuthenticationWrongNumberOfArgsErrortBusyLoadingErrortChildDeadlockedErrortConnectionErrort	DataErrortExecAbortErrortInvalidResponsetNoPermissionErrort
NoScriptErrort
ReadOnlyErrort
RedisErrort
ResponseErrortTimeoutError(tHIREDIS_AVAILABLEuSSLWantReadErrorii���u0.1.3u0.1.4u1.0.0u`redis-py works best with hiredis >= 0.1.4. You're running hiredis %s. Please consider upgrading.t*t$s
tuConnection closed by server.tEncodercBs,eZdZd�Zd�Zed�ZRS(u=Encode strings to bytes-like and decode bytes-like to stringscCs||_||_||_dS(N(tencodingtencoding_errorstdecode_responses(tselfR*R+R,((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyt__init__bs		cCs�t|ttf�r|St|t�r7td��nt|t�r[t|�j�}n[t|tt	f�r�t
|�j�}n1t|t�s�t|�j
}td|��nt|t�r�|j|j|j�}n|S(u=Return a bytestring or bytes-like representation of the valueuNInvalid input of type: 'bool'. Convert to a bytes, string, int or float first.uLInvalid input of type: '%s'. Convert to a bytes, string, int or float first.(t
isinstancetbytest
memoryviewtboolRtfloattreprtencodetintRtstrR	ttypet__name__RR*R+(R-tvaluettypename((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR5gs
cCs^|js|rZt|t�r-|j�}nt|t�rZ|j|j|j�}qZn|S(u:Return a unicode string from the bytes-like representation(R,R/R1ttobytesR0tdecodeR*R+(R-R:tforce((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR=}s(R9t
__module__t__doc__R.R5tFalseR=(((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR)_s		t
BaseParsercBskeZiied6ed6ed6ed6ed6d6ed6ed6ed6ed	6ed
6e	d6Z
d�ZRS(
umax number of clients reachedu(Client sent AUTH, but no password is setuinvalid passwordu,wrong number of arguments for 'auth' commandu,wrong number of arguments for 'AUTH' commanduERRu	EXECABORTuLOADINGuNOSCRIPTuREADONLYuNOAUTHuNOPERMcCs{|jd�d}||jkrq|t|�d}|j|}t|t�rg|j|t�}n||�St|�S(uParse an error responseu ii(tsplittEXCEPTION_CLASSEStlenR/tdicttgetR#(R-tresponset
error_codetexception_class((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pytparse_error�s

(R9R?RRRRRR R!RRDRK(((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyRB�s
tSocketBuffercBs_eZd�Zed��Zdeed�Zd�Z	d�Z
d�Zd�Zd�Z
RS(	cCs@||_||_||_tj�|_d|_d|_dS(Ni(t_socktsocket_read_sizetsocket_timeouttiotBytesIOt_buffert
bytes_writtent
bytes_read(R-tsocketRNRO((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR.�s				cCs|j|jS(N(RSRT(R-((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pytlength�sc
Cs�|j}|j}|j}|j|j�d}|tk	}zBy�|rY|j|�nx�tr�t|j|�}	t	|	t
�r�t|	�dkr�tt
��n|j|	�t|	�}
|j|
7_||
7}|dk	r�||kr�q\ntSWWn�tjk
r&|r"td��ntStk
r}}tj|jd�}|rd|j|krdtStd|jf��nXWd|r�|j|j�nXdS(NiuTimeout reading from socketi����u#Error while reading from socket: %s(RMRNRRtseekRStSENTINELt
settimeouttTrueRR/R0RERtSERVER_CLOSED_CONNECTION_ERRORtwritetNoneRUttimeoutR$RAtNONBLOCKING_EXCEPTIONSt#NONBLOCKING_EXCEPTION_ERROR_NUMBERSRGt	__class__terrnotargsRO(
R-RVR^traise_on_timeouttsockRNtbuftmarkertcustom_timeouttdatatdata_lengthtextallowed((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyt_read_from_socket�sB				!

	cCs%t|j�p$|jd|dt�S(NR^Rd(R2RVRmRA(R-R^((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pytcan_read�scCs�|d}||jkr0|j||j�n|jj|j�|jj|�}|jt|�7_|j|jkr�|j�n|d S(Nii����(	RVRmRRRWRTtreadRERStpurge(R-RVRi((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyRo�s

cCs�|j}|j|j�|j�}x9|jt�s`|j�|j|j�|j�}q(W|jt|�7_|j|jkr�|j	�n|d S(Ni����(
RRRWRTtreadlinetendswithtSYM_CRLFRmRERSRp(R-RfRi((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyRq�s	

cCs3|jjd�|jj�d|_d|_dS(Ni(RRRWttruncateRSRT(R-((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyRp
s
	cCsEy|j�|jj�Wntk
r.nXd|_d|_dS(N(RpRRtcloset	ExceptionR]RM(R-((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyRus

	N(R9R?R.tpropertyRVR]RXRZRmRnRoRqRpRu(((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyRL�s	
*				tPythonParsercBsDeZdZd�Zd�Zd�Zd�Zd�Zd�ZRS(uPlain Python parsing classcCs(||_d|_d|_d|_dS(N(RNR]tencoderRMRR(R-RN((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR.$s			cCs&y|j�Wntk
r!nXdS(N(t
on_disconnectRv(R-((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyt__del__*s
cCs:|j|_t|j|j|j�|_|j|_dS(uCalled when the socket connectsN(RMRLRNRORRRy(R-t
connection((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyt
on_connect0s
	cCs>d|_|jdk	r1|jj�d|_nd|_dS(u"Called when the socket disconnectsN(R]RMRRRuRy(R-((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyRz8s
	
cCs|jo|jj|�S(N(RRRn(R-R^((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyRn@scCsz|jj�}|s$tt��n|d |d}}|d	krXtd|��n|dkr�t|�}|j|�}t|t�r�|�n|S|dkr�n�|dkr�t|�}n�|dkrt	|�}|dkr�dS|jj|�}nP|dkrRt	|�}|dkr*dSgt|�D]}|j
�^q7}nt|t�rv|jj|�}n|S(
Nit-t+t:R'R&uProtocol Error: %ri����(R~RR�R'R&(RRRqRR[RRRKR/RR6R]RoRt
read_responseR0RyR=(R-trawtbyteRHterrorRVti((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR�Cs:	((	R9R?R@R.R{R}RzRnR�(((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyRx"s					t
HiredisParsercBsSeZdZd�Zd�Zd�Zd�Zd�Zee	d�Z
d�ZRS(u*Parser class for connections using HirediscCs:tstd��n||_tr6t|�|_ndS(NuHiredis is not installed(R%R"RNtHIREDIS_USE_BYTE_BUFFERt	bytearrayRR(R-RN((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR.ss
	cCs&y|j�Wntk
r!nXdS(N(RzRv(R-((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR{{s
cCs�|j|_|j|_itd6|jd6}tsBt|d<n|jjra|jj	|d<nt
rz|jj|d<ntj
|�|_t|_dS(Nu
protocolErroru
replyErroruencodinguerrors(RMROt_socket_timeoutRRKt HIREDIS_SUPPORTS_CALLABLE_ERRORSR#RyR,R*t HIREDIS_SUPPORTS_ENCODING_ERRORSR+thiredistReadert_readerRAt_next_response(R-R|tkwargs((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR}�s

cCsd|_d|_t|_dS(N(R]RMR�RAR�(R-((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyRz�s		cCse|jstt��n|jtkra|jj�|_|jtkra|jd|dt�SntS(NR^Rd(R�RR[R�RAtgetstread_from_socketRZ(R-R^((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyRn�s	
c	Cs�|j}|tk	}zNy�|r1|j|�ntr�t|j|j�}|dkrgtt��n|jj	|jd|�nVt
|j|j�}t|t
�s�t|�dkr�tt��n|jj	|�tSWn�tjk
r
|rtd��ntStk
ra}tj|jd�}|rH|j|krHtStd|jf��nXWd|r|j|j�nXdS(NiuTimeout reading from socketi����u#Error while reading from socket: %s(RMRXRYR�RRRRR[R�tfeedRRNR/R0RERZRUR^R$RAR_R`RGRaRbRcR�(	R-R^RdReRhtbufflentbufferRkRl((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR��s8	"cCsC|jstt��n|jtk	r=|j}t|_|S|jj�}x)|tkrw|j�|jj�}qOWts�t|t	�r�|j
|jd�}q�t|t�r�|r�t|dt	�r�|j
|djd�|d<q�nt|t�r
|�n5t|t�r?|r?t|dt�r?|d�n|S(Ni(
R�RR[R�RAR�R�R�R/R#RKRctlist(R-RH((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR��s,			
$	
(R9R?R@R.R{R}RzRnRXRZR�R�(((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR�qs					&t
ConnectioncBs�eZdZddddddeddeddeeddddd�Zd�Zd	�Zd
�Z	d�Z
d�Zd
�Zd�Z
d�Zd�Zd�Zd�Zed�Zd�Zdd�Zd�Zd�Zd�ZRS(u4Manages TCP communication to and from a Redis serveru	localhosti�iuutf-8ustricticCs�tj�|_||_t|�|_||_||_||_||_	||_
|p]||_||_|pui|_
|	|_|
|_||_d|_t|||
�|_d|_|d|�|_g|_d|_dS(NiRNip(tostgetpidtpidthostR6tporttdbtusernametclient_nametpasswordROtsocket_connect_timeouttsocket_keepalivetsocket_keepalive_optionstsocket_typetretry_on_timeoutthealth_check_intervaltnext_health_checkR)RyR]RMt_parsert_connect_callbackst_buffer_cutoff(R-R�R�R�R�ROR�R�R�R�R�R*R+R,tparser_classRNR�R�R�((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR.�s(													cCsLdjg|j�D]\}}d||f^q�}d|jj|fS(Nu,u%s=%su%s<%s>(tjointrepr_piecesRaR9(R-tktvt	repr_args((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyt__repr__s8cCsPd|jfd|jfd|jfg}|jrL|jd|jf�n|S(Nuhostuportudbuclient_name(R�R�R�R�tappend(R-tpieces((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR�s	cCs&y|j�Wntk
r!nXdS(N(t
disconnectRv(R-((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR{s
cCs|jj|�dS(N(R�R�(R-tcallback((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pytregister_connect_callback$scCs
g|_dS(N(R�(R-((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pytclear_connect_callbacks'scCs�|jr
dSy|j�}WnJtjk
r?td��n+tjk
ri}t|j|���nX||_y|j�Wnt	k
r�|j
��nXx|jD]}||�q�WdS(u5Connects to the Redis server if not already connectedNuTimeout connecting to server(RMt_connectRUR^R$R�Rt_error_messageR}R"R�R�(R-ReteR�((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pytconnect*s 		

cCsnd}x=tj|j|j|jtj�D]}|\}}}}}d}y�tj|||�}|jtjtj	d�|j
r�|jtjtjd�x6t
|j�D]"\}	}
|jtj|	|
�q�Wn|j|j�|j|�|j|j�|SWq+tjk
rA}|}|dk	rB|j�qBq+Xq+W|dk	r[|�ntjd��dS(uCreate a TCP socket connectioniu)socket.getaddrinfo returned an empty listN(R]RUtgetaddrinfoR�R�R�tSOCK_STREAMt
setsockopttIPPROTO_TCPtTCP_NODELAYR�t
SOL_SOCKETtSO_KEEPALIVER
R�RYR�R�ROR�Ru(R-terrtrestfamilytsocktypetprotot	canonnametsocket_addressReR�R�t_((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR�Bs.	
	cCs_t|j�dkr3d|j|j|jdfSd|jd|j|j|jdfSdS(NiuError connecting to %s:%s. %s.iu!Error %s connecting to %s:%s. %s.(RERcR�R�(R-t	exception((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR�js
cCsh|jj|�|js"|jr�|jrF|j|jp=df}n|jf}|jddt|�y|j�}Wn6tk
r�|jd|jdt�|j�}nXt|�dkr�t	d��q�n|j
r|jdd|j
�t|j��dkrtd��qn|jrd|jd	|j�t|j��dkrdtd
��qdndS(u=Initialize the connection, authenticate and select a databaseuuAUTHtcheck_healthuOKuInvalid Username or PassworduCLIENTuSETNAMEuError setting client nameuSELECTuInvalid DatabaseN(
R�R}R�R�tsend_commandRAR�RRRR�RR�(R-t	auth_argst
auth_response((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR}ts*	
		cCs�|jj�|jdkr dSy<tj�|jkrNt|jtj	�n|jj
�Wntjk
rrnXd|_dS(u!Disconnects from the Redis serverN(R�RzRMR]R�R�R�RRUt	SHUT_RDWRRuR�(R-((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR��s
cCs�|jr�t�|jkr�y>|jddt�t|j��dkrXtd��nWq�ttfk
r�|j	�|jddt�t|j��dkr�td��q�q�XndS(u3Check the health of the connection with a PING/PONGuPINGR�uPONGu#Bad response from PING health checkN(
R�RR�R�RARR�RR$R�(R-((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR��s
cCs2|js|j�n|r)|j�ny@t|t�rG|g}nx|D]}t|j|�qNWWn�tjk
r�|j�t	d��n�tj
k
r}|j�t|j�dkr�d|jd}}n|jd}|jd}t
d||f��ntk
r-|j��nXdS(u2Send an already packed command to the Redis serveruTimeout writing to socketiuUNKNOWNiu%Error %s while writing to socket. %s.N(RMR�R�R/R7RRUR^R�R$R�RERcRt
BaseException(R-tcommandR�titemR�Rbterrmsg((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pytsend_packed_command�s.	








cOs,|j|j|�d|jdt��dS(u+Pack and send a command to the Redis serverR�ucheck_healthN(R�tpack_commandRGRZ(R-RcR�((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR��scCs5|j}|s%|j�|j}n|jj|�S(u8Poll the socket to see if there's data that can be read.(RMR�R�Rn(R-R^Re((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyRn�s
	
cCs�y|jj�}Wn�tjk
rO|j�td|j|jf��n_tjk
r�}|j�t	d|j|j|j
f��ntk
r�|j��nX|jr�t
�|j|_nt|t�r�|�n|S(u0Read the response from a previously sent commanduTimeout reading from %s:%su#Error while reading from %s:%s : %s(R�R�RUR^R�R$R�R�R�RRcR�R�RR�R/R#(R-RHR�((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR��s$



		cGs�g}t|dt�r@t|dj�j��|d}n1d|dkrqt|dj��|d}ntjttt	|��j�t
f�}|j}x�t|j
j|�D]�}t	|�}t	|�|ks�||ks�t|t�rCtj|tt|�j�t
f�}|j|�|j|�t
}q�tj|tt|�j�t
|t
f�}q�W|j|�|S(u2Pack a series of arguments into the Redis protocoliit (R/RttupleR5RCt	SYM_EMPTYR�tSYM_STARR7RERsR�RRyR1t
SYM_DOLLARR�(R-Rctoutputtbufft
buffer_cutofftargt
arg_length((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR��s*'!*	!

	
c	Csg}g}d}|j}x�|D]�}x�|j|�D]�}t|�}||ksq||ksqt|t�r�|jtj|��d}g}n||ks�t|t�r�|j|�q8|j|�||7}q8Wq"W|r�|jtj|��n|S(u.Pack multiple commands into the Redis protocoli(R�R�RER/R1R�R�R�(	R-tcommandsR�R�t
buffer_lengthR�tcmdtchunktchunklen((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyt
pack_commandss&	
	
N(R9R?R@R]RAt
DefaultParserR.R�R�R{R�R�R�R�R�R}R�R�RZR�R�RnR�R�R�(((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR��s2			
					(	
	'	
				"t
SSLConnectioncBs)eZdddded�Zd�ZRS(urequiredcKs�tstd��ntt|�j|�||_||_|dkrUtj	}n_t
|t�r�itj	d6tjd6tj
d6}||kr�td|��n||}n||_||_||_dS(Nu$Python wasn't built with SSL supportunoneuoptionalurequiredu-Invalid SSL Certificate Requirements Flag: %s(t
ssl_availableR"tsuperR�R.tkeyfiletcertfileR]tsslt	CERT_NONER/R	t
CERT_OPTIONALt
CERT_REQUIREDt	cert_reqstca_certstcheck_hostname(R-tssl_keyfiletssl_certfilet
ssl_cert_reqstssl_ca_certstssl_check_hostnameR�t	CERT_REQS((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR.6s(		




		cCs�tt|�j�}ttd�r�tj�}|j|_|j|_|j	ry|j
ry|jd|j	d|j
�n|jr�|j
|j�nt||d|j�}n3tt|d|jd|j
d|j	d|j�}|S(u Wrap the socket with SSL supportucreate_default_contextR�R�tserver_hostnameR�R�(R�R�R�thasattrR�tcreate_default_contextR�R�tverify_modeR�R�tload_cert_chainR�tload_verify_locationsRR�(R-Retcontext((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR�Qs$
				N(R9R?R]RAR.R�(((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR�4stUnixDomainSocketConnectioncBsSeZddd	d	d	ddeeeddd	d�
Zd�Zd�Zd�ZRS(
uiuutf-8ustricticCs�tj�|_||_||_||_|
|_||_||_|	|_	||_
d|_t|||�|_
d|_|
d|�|_g|_d|_dS(NiRNip(R�R�R�tpathR�R�R�R�ROR�R�R�R)RyR]RMR�R�R�(R-RR�R�R�ROR*R+R,R�R�RNR�R�((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR.ls											cCsDd|jfd|jfg}|jr@|jd|jf�n|S(Nupathudbuclient_name(RR�R�R�(R-R�((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR��s
	cCs<tjtjtj�}|j|j�|j|j�|S(u&Create a Unix domain socket connection(RUtAF_UNIXR�RYROR�R(R-Re((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR��scCsSt|j�dkr-d|j|jdfSd|jd|j|jdfSdS(Niu(Error connecting to unix socket: %s. %s.iu+Error %s connecting to unix socket: %s. %s.(RERcR(R-R�((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR��s
N(	R9R?R]RAR�R.R�R�R�(((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyRjs			u0uFuFALSEuNuNOcCsK|dks|dkrdSt|t�rA|j�tkrAtSt|�S(Nu(R]R/R	tuppert
FALSE_STRINGSRAR2(R:((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pytto_bool�s
!usocket_timeoutusocket_connect_timeoutusocket_keepaliveuretry_on_timeoutumax_connectionsuhealth_check_intervalussl_check_hostnametConnectionPoolcBs�eZdZeded��Zedd�Zd�Z	d�Z
d�Zd�Zd�Z
d�Zd	�Zd
�Zed�ZRS(
uGeneric connection poolcKs%t|�}i}x�tt|j��D]�\}}|r(t|�dkr(tj|�}|r�y||d�||<Wq�ttfk
r�t	j
td|��q�Xq�|d||<q(q(W|rC|jr�t
|j�nd}	|jr�t
|j�nd}
|jrt
|j�nd}|jr:t
|j�nd}n0|jpOd}	|jp^d}
|j}|j}|jdkr�|ji|	d6|
d6|d6td6�n�|jdkrc|ji|d
6t|jp�d�d6|	d6|
d6�d
|krD|rDy t|jdd��|d
<WqDttfk
r@qDXn|jd	kr�t|d<q�ndjd�}
td|
��t|jd
|p�d��|d
<|j|�d|kr�t	j
td��|jd�|d<nd|krt	j
td��|jd�|d<n||�S(u
        Return a connection pool configured from the given URL.

        For example::

            redis://[[username]:[password]]@localhost:6379/0
            rediss://[[username]:[password]]@localhost:6379/0
            unix://[[username]:[password]]@/path/to/socket.sock?db=0

        Three URL schemes are supported:

        - ```redis://``
          <https://www.iana.org/assignments/uri-schemes/prov/redis>`_ creates a
          normal TCP socket connection
        - ```rediss://``
          <https://www.iana.org/assignments/uri-schemes/prov/rediss>`_ creates
          a SSL wrapped TCP socket connection
        - ``unix://`` creates a Unix Domain Socket connection

        There are several ways to specify a database number. The parse function
        will return the first specified option:
            1. A ``db`` querystring option, e.g. redis://localhost?db=0
            2. If using the redis:// scheme, the path argument of the url, e.g.
               redis://localhost/0
            3. The ``db`` argument to this function.

        If none of these options are specified, db=0 is used.

        The ``decode_components`` argument allows this function to work with
        percent-encoded URLs. If this argument is set to ``True`` all ``%xx``
        escapes will be replaced by their single-character equivalents after
        the URL has been parsed. This only applies to the ``hostname``,
        ``path``, ``username`` and ``password`` components.

        Any additional querystring arguments and keyword arguments will be
        passed along to the ConnectionPool class's initializer. The querystring
        arguments ``socket_connect_timeout`` and ``socket_timeout`` if supplied
        are parsed as float values. The arguments ``socket_keepalive`` and
        ``retry_on_timeout`` are parsed to boolean values that accept
        True/False, Yes/No values to indicate state. Invalid types cause a
        ``UserWarning`` to be raised. In the case of conflicting arguments,
        querystring arguments always win.

        iu)Invalid value for `%s` in connection URL.uunixuusernameupasswordupathuconnection_classuredisuredissuhosti�uportudbu/uu, uredis://u	rediss://uunix://u8Redis URL must specify one of the following schemes (%s)ucharsetu/"charset" is deprecated. Use "encoding" insteaduencodinguerrorsu5"errors" is deprecated. Use "encoding_errors" insteaduencoding_errorsN(uredisurediss(uredis://u	rediss://uunix://(RR
RtqueryREtURL_QUERY_ARGUMENT_PARSERSRGt	TypeErrort
ValueErrortwarningstwarntUserWarningR�RR]R�RthostnametschemetupdateRR6R�treplacetAttributeErrorR�R�tDeprecationWarningtpop(tclsturlR�tdecode_componentsR�turl_optionstnameR:tparserR�R�RRt
valid_schemes((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pytfrom_url�sl."	!				 
"
	
	
cKsu|p	d}t|ttf�s.|dkr=td��n||_||_||_tj�|_	|j
�dS(u�
        Create a connection pool. If max_connections is set, then this
        object raises redis.ConnectionError when the pool's limit is reached.

        By default, TCP connections are created unless connection_class is
        specified. Use redis.UnixDomainSocketConnection for unix sockets.

        Any additional keyword arguments are passed to the constructor of
        connection_class.
        iiiu,"max_connections" must be a positive integerNI�(R/R6RRtconnection_classtconnection_kwargstmax_connectionst	threadingtLockt
_fork_locktreset(R-RR R((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR.0s"			
cCs)dt|�jt|j|j��fS(Nu%s<%s>(R8R9R4RR(R-((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR�OscCs@tj�|_d|_g|_t�|_tj�|_	dS(Ni(
R!R"t_lockt_created_connectionst_available_connectionstsett_in_use_connectionsR�R�R�(R-((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR$Us
		cCs�|jtj�kr�t�d}t}x/t�|krY|jjt�}|r+Pq+q+W|sit�nz&|jtj�kr�|j�nWd|jj	�XndS(Ni(
R�R�R�RRAR#tacquireRR$trelease(R-t
timeout_attacquired((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyt	_checkpidfs#
	c	Os�|j�|j�Hy|jj�}Wntk
rF|j�}nX|jj|�WdQXyp|j�y|j	�r�t
d��nWn@t
k
r�|j�|j�|j	�r�t
d��q�nXWn!tk
r�|j
|��nX|S(uGet a connection from the poolNuConnection has datauConnection not ready(R.R%R'Rt
IndexErrortmake_connectionR)taddR�RnRR�R�R+(R-tcommand_nametkeystoptionsR|((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pytget_connection�s*








c	CsF|j}td|jdd�d|jdd�d|jdt��S(	u,Return an encoder based on encoding settingsR*uencodinguutf-8R+uencoding_errorsustrictR,udecode_responses(RR)RGRA(R-R�((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pytget_encoder�s
	cCs@|j|jkr!td��n|jd7_|j|j�S(uCreate a new connectionuToo many connectionsi(R&R RRR(R-((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR0�sc	Cs�|j�|j�ly|jj|�Wntk
r;nX|j|�r^|jj|�n|jd8_|j	�dSWdQXdS(u(Releases the connection back to the pooliN(
R.R%R)tremovetKeyErrortowns_connectionR'R�R&R�(R-R|((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR+�s



cCs|j|jkS(N(R�(R-R|((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR9�scCs`|j�|j�G|r2t|j|j�}n	|j}x|D]}|j�qBWWdQXdS(u�
        Disconnects connections in the pool

        If ``inuse_connections`` is True, disconnect connections that are
        current in use, potentially by other threads. Otherwise only disconnect
        connections that are idle in the pool.
        N(R.R%RR'R)R�(R-tinuse_connectionstconnectionsR|((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR��s

		
N(R9R?R@tclassmethodR]RARR�R.R�R$R.R5R6R0R+R9RZR�(((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR�sz			6	!					tBlockingConnectionPoolcBsPeZdZddeed�Zd�Zd�Zd�Zd�Z	d�Z
RS(	u6
    Thread-safe blocking connection pool::

        >>> from redis.client import Redis
        >>> client = Redis(connection_pool=BlockingConnectionPool())

    It performs the same function as the default
    ``:py:class: ~redis.connection.ConnectionPool`` implementation, in that,
    it maintains a pool of reusable connections that can be shared by
    multiple redis clients (safely across threads if required).

    The difference is that, in the event that a client tries to get a
    connection from the pool when all of connections are in use, rather than
    raising a ``:py:class: ~redis.exceptions.ConnectionError`` (as the default
    ``:py:class: ~redis.connection.ConnectionPool`` implementation does), it
    makes the client wait ("blocks") for a specified number of seconds until
    a connection becomes available.

    Use ``max_connections`` to increase / decrease the pool size::

        >>> pool = BlockingConnectionPool(max_connections=10)

    Use ``timeout`` to tell it either how many seconds to wait for a connection
    to become available, or to block forever:

        # Block forever.
        >>> pool = BlockingConnectionPool(timeout=None)

        # Raise a ``ConnectionError`` after five seconds if a connection is
        # not available.
        >>> pool = BlockingConnectionPool(timeout=5)
    i2icKs8||_||_tt|�jd|d||�dS(NRR (tqueue_classR^R�R=R.(R-R R^RR>R((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR.s		cCsg|j|j�|_x3trJy|jjd�Wqtk
rFPqXqWg|_tj	�|_
dS(N(R>R tpoolRZt
put_nowaitR]R
t_connectionsR�R�R�(R-((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR$%s	
		cCs&|j|j�}|jj|�|S(uMake a fresh connection.(RRRAR�(R-R|((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR0=scOs|j�d}y"|jjdtd|j�}Wntk
rQtd��nX|dkrm|j�}nyp|j	�y|j
�r�td��nWn@tk
r�|j�|j	�|j
�r�td��q�nXWn!tk
r|j
|��nX|S(u7
        Get a connection, blocking for ``self.timeout`` until a connection
        is available from the pool.

        If the connection returned is ``None`` then creates a new connection.
        Because we use a last-in first-out queue, the existing connections
        (having been returned to the pool after the initial ``None`` values
        were added) will be returned before ``None`` values. This means we only
        create new connections when we need to, i.e.: the actual number of
        connections will only increase in response to demand.
        tblockR^uNo connection available.uConnection has datauConnection not readyN(R.R]R?RGRZR^RRR0R�RnR�R�R+(R-R2R3R4R|((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR5Cs,
"






cCsc|j�|j|�s7|j�|jjd�dSy|jj|�Wntk
r^nXdS(u)Releases the connection back to the pool.N(R.R9R�R?R@R]R
(R-R|((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR+ws


cCs,|j�x|jD]}|j�qWdS(u(Disconnects all connections in the pool.N(R.RAR�(R-R|((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR��s
(R9R?R@R�RR.R$R0R5R+R�(((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyR=�s 
			4	(at
__future__Rtdistutils.versionRt	itertoolsRRRbRPR�RUR!Rt
redis._compatRRRRRR	R
RRR
RRRRRRRRRtredis.exceptionsRRRRRRRRRR R!R"R#R$tredis.utilsR%R�RZR�tImportErrorRAtEWOULDBLOCKR`R�tSSLWantReadErrortSSLWantWriteErrortSSLErrorR�R�R3R_R�t__version__thiredis_versionR�tHIREDIS_SUPPORTS_BYTE_BUFFERR�tmsgR
R�R�R�RsR�R[tobjectRXR)RBRLRxR�R�R�R�RRRR3R6R	RR=(((sA/opt/alt/python27/lib/python2.7/site-packages/redis/connection.pyt<module>s�|^




	
	(#xOz	�D63	
�G

Youez - 2016 - github.com/yon3zu
LinuXploit