File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66"""
77
88import copy
9+ import threading
910import types
1011
1112from thirdparty .odict import OrderedDict
@@ -142,6 +143,7 @@ class LRUDict(object):
142143 def __init__ (self , capacity ):
143144 self .capacity = capacity
144145 self .cache = OrderedDict ()
146+ self .__lock = threading .Lock ()
145147
146148 def __len__ (self ):
147149 return len (self .cache )
@@ -158,11 +160,12 @@ def get(self, key):
158160 return self .__getitem__ (key )
159161
160162 def __setitem__ (self , key , value ):
161- try :
162- self .cache .pop (key )
163- except KeyError :
164- if len (self .cache ) >= self .capacity :
165- self .cache .popitem (last = False )
163+ with self .__lock :
164+ try :
165+ self .cache .pop (key )
166+ except KeyError :
167+ if len (self .cache ) >= self .capacity :
168+ self .cache .popitem (last = False )
166169 self .cache [key ] = value
167170
168171 def set (self , key , value ):
Original file line number Diff line number Diff line change 2020from thirdparty .six import unichr as _unichr
2121
2222# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
23- VERSION = "1.8.1.6 "
23+ VERSION = "1.8.1.7 "
2424TYPE = "dev" if VERSION .count ('.' ) > 2 and VERSION .split ('.' )[- 1 ] != '0' else "stable"
2525TYPE_COLORS = {"dev" : 33 , "stable" : 90 , "pip" : 34 }
2626VERSION_STRING = "sqlmap/%s#%s" % ('.' .join (VERSION .split ('.' )[:- 1 ]) if VERSION .count ('.' ) > 2 and VERSION .split ('.' )[- 1 ] == '0' else VERSION , TYPE )
You can’t perform that action at this time.
0 commit comments