403Webshell
Server IP : 182.53.201.61  /  Your IP : 216.73.217.175
Web Server : Apache/2.2.15 (Fedora)
System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python2.6/site-packages/khashmir/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.6/site-packages/khashmir/ktable.pyo
Ñò
²ÅßCc@síddklZddkTddkTddkZddkZddklZl	Z	l
Z
lZlZddk
lZd„Zdefd„ƒYZd	efd
„ƒYZddkZdeifd„ƒYZed
joeiƒndS(iÿÿÿÿ(tbttime(t*N(tKtHASH_LENGTHtNULL_IDtMAX_FAILUREStMIN_PING_INTERVAL(tNodecCst|i|iƒS(N(tcmptlastSeen(tatb((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pytlsstKTablecBszeZdZd„Zd„Zd„Zed„Zd„Zd„Z	de
d	„Zd
„Zd„Z
d„Zd
„ZRS(tnodetbucketscCs6||_tgddtƒg|_|i|ƒdS(Nll(RtKBucketRRt
insertNode(tselfR((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyt__init__s	cCst|i|ƒS(s,the index of the bucket that should hold int(tbisect_leftR(Rtnum((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyt_bucketIndexForInt!scCs|i|i|ƒS(N(RR(RR((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pytbucketForInt%sc	Cs2t|tƒoti|ƒ}nQt|tƒo
|i}n4t|tƒpt|tƒo
|}n
td‚g}|i	|ƒ}y|i
|i|ƒ}Wntj
on	X|gS||i
|i
}|p3g}|D]}|ip||qåqå~}nt|ƒtjo÷|d}	|d}
xàt|ƒtjoÈ|	djp|
t|i
ƒjo¥|	djo||i
|	i
}n|
t|i
ƒjo||i
|
i
}n|	d}	|
d}
|p3g}|D]}|ip||qæqæ~}q7q7Wn|i|d„ƒ|t S(sN
            return K nodes in our own local table closest to the ID.
        s*findNodes requires an int, string, or NodeiicSst||iA||iAƒS((RR(R
RR((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyt<lambda>Ts(t
isinstancetstrthashtintifyRRtinttlongt	TypeErrorRRtgetNodeWithIntt
ValueErrortltinvalidtlenRtsort(RtidR#RtnodestiRt_[1]R
tmintmaxt_[2]((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyt	findNodes(s@
 
	3

6


<cCs°|i|id}tg|i||iƒ}|ii|ii|iƒd|ƒ|i||_xC|iD]7}|i|ijo|i|ƒ|i	|ƒqqqqWdS(Nii(
R+R*RRtinserttindexR"Rt
removeNodetaddNode(RR
tdiffRtanode((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyt_splitBucketWs&
cCsš|i|iƒ}|i|i|ƒo|i|i|ƒn|o/|i|i|ƒo|i|i|ƒn |o|i|i|ƒndS(stthis is used by clients to replace a node returned by insertNode after
        it fails to respond to a Pong messageN(RRRthasNodeR0tseenNodeR1(RtstaletnewR(((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pytreplaceStaleNodebsicCs9|itjp|i|iijodS|o|iƒn|i|iƒ}|i|i|ƒo¤|i|ii	|iƒ}|i|i|}|o$|i
|_
|i|i|ƒnE|idjo4|i
|i
jo!|i|ijo|iƒndS|i|iƒp|i|i|ƒdStƒ}g}|i|iiƒD]}	|	io||	q^q^~}
t|
ƒo¾|o¶|
itƒxJ|
oB|i|i|
dƒo&|i|i|
di=|
d}
q§W|
o1|
didjo|
ditjo	|
dS|
o|i|
d|ƒdSng}|i|iD]%}||itjo||qbqb~}
t|
ƒo|o|
itƒ|
dS|i|i|ijo|i|ijnpdSt|iƒtjo
dGHdS|i|i|ƒ|i||ƒS(sF 
        this insert the node, returning None if successful, returns the oldest node in the bucket if it's full
        the caller responsible for pinging the returned node and calling replaceStaleNode if it is found to be stale!!
        contacted means that yes, we contacted THEM and we know the node is reachable
        Niis Hash Table is FULL!  Increase K!( R&RRtupdateLastSeenRRRR5R"R/tageR6R	tportthostt
bucketFullR1ttimeR#tvaluesR$R%RtfailsRR9RR*R+RR4R(RRt	contactedtnocheckR(tittxnodettR)txR#R,tnR7((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyRpsR&6	?
#/		C
	5cCshy|i|ƒd}Wntj
odSX|i}|iƒ|i|iƒ}|i|ƒ|SdS(sfcall this any time you get a message from a node
        it will update it in the table if it's there iN(R-t
IndexErrortNoneR	R:RRR6(RR&RHttstamptbucket((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pytjustSeenNode±s	

cCs,t|_|i|iƒ}|i|ƒdS(sR
            forget about node n - use when you know that node is invalid
        N(tTrueR#RRtinvalidateNode(RRHRL((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyRO¿s	cCs\y|i|iƒd}Wntj
odSX|iƒtijo|i|ƒndS(sN call this when a node fails to respond to a message, to invalidate that node iN(R-RRIRJt	msgFailedtconstRRO(RRRH((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyt
nodeFailedÇscCsddt|iƒdS(s7 estimated number of connectable nodes in global table iii(R$R(R((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pytnumPeersÑs(snodesbuckets(t__name__t
__module__t	__slots__RRRRNR-R4R9tFalseRRMRORRRS(((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyR
s			/		A			
RcBs°eZdZd„Zd„Zd„Zd	„Zd
„Zd„Zd„Z	d
„Z
d„Zd„Zd„Z
d„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(R*R+tlastAccessedR"R/R#cCs=||_h|_h|_||_||_tƒ|_dS(N(R"R/R#R*R+R?RX(RtcontentsR*R+((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyR×s					cCstƒ|_dS(N(R?RX(R((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyttouchßscCs4|i|ijodS|i|ijodSdS(Niiÿÿÿÿi(R	(RR
R((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pytlacmpâs
cCs|ii|iƒdS(N(R"R%R[(R((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyR%éscCs1y|i|}Wntj
o
t‚nX|S(N(R/tKeyErrorR!(RRR((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyR ìs
cCsdt|iƒtjodS|ii|iƒodS|ii|ƒ||i|i<|iƒdS(N(R$R"RR/thas_keyRtappendRZ(RR((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyR1óscCs[|i|ii|iƒ=|i|i=y|i|i=Wntj
onX|iƒdS(N(R"R/RR#R\RZ(RR((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyR0üs
cCs||i|i<dS(N(R#R(RR((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyROscCsjy|i|i=Wntj
onX|ii|iƒ}|i|=|ii|ƒ||i|i<dS(N(R#RR\R"R/R^(RRRD((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyR6	s
cCs|ii|iƒS(N(R/R]R(RR((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyR5scCst|iƒtjS(N(R$R"R(R((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyR>scCs dt|iƒ|i|ifS(Ns<KBucket %d items (%d to %d)>(R$R"R*R+(R((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyt__repr__scCs*t|tƒo
|i}n|i|jS(N(RRRR+(RR
((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyt__lt__s
cCs*t|tƒo
|i}n|i|jS(N(RRRR*(RR
((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyt__le__"s
cCs*t|tƒo
|i}n|i|jS(N(RRRR*(RR
((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyt__gt__%s
cCs*t|tƒo
|i}n|i|jS(N(RRRR+(RR
((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyt__ge__(s
cCs:t|tƒo
|i}n|i|jo
|i|jS(N(RRRR*R+(RR
((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyt__eq__+s
cCs:t|tƒo
|i}n|i|jp
|i|jS(N(RRRR*R+(RR
((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyt__ne__.s
(sminsmaxslastAccessedR"sindexsinvalid(RTRURVRRZR[R%R R1R0ROR6R5R>R_R`RaRbRcRdRe(((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyRÕs&								
		
								t
TestKTablecBs,eZd„Zd„Zd„Zd„ZRS(cCs7tƒitiƒddƒ|_t|iƒ|_dS(Nt	localhostiÒ(RtinitRtnewIDR
R
RF(R((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pytsetUp7s!cCstƒitiƒddƒ|_|ii|iƒ|it|ii	di
ƒdƒ|i|ii	di
d|iƒdS(NRgiÓii(RRhRRiRRFRtassertEqualR$RR"(R((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyttestAddNode;s!#cCsD|iƒ|ii|iƒ|it|iidiƒdƒdS(Ni(RlRFRORRkR$RR"(R((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyt
testRemoveAs
cCs¼|iƒxuttidƒD]`}|ii|iƒ|it|ii	di
ƒdƒ|i|ii	di
d|iƒqW|ii|iƒ|it|ii	di
ƒdƒdS(Nii(RltrangeRQRRFRRRRkR$RR"(RR(((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyttestFailFs
#((RTRURjRlRmRo(((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyRf6s			t__main__(tBitTorrent.platformRR?tbisectttypestkhashRRQRRRRRRRRtobjectR
RtunittesttTestCaseRfRTtmain(((s3/usr/lib/python2.6/site-packages/khashmir/ktable.pyt<module>s

(	½_


Youez - 2016 - github.com/yon3zu
LinuXploit