mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-10-20 18:54:02 +00:00
parent
2cc6214227
commit
4147f44e63
12 changed files with 53 additions and 12 deletions
|
|
@ -7,6 +7,8 @@ See the file 'LICENSE' for copying permission
|
|||
|
||||
import hashlib
|
||||
|
||||
from lib.core.threads import getCurrentThreadData
|
||||
|
||||
def cachedmethod(f, cache={}):
|
||||
"""
|
||||
Method with a cached content
|
||||
|
|
@ -22,3 +24,18 @@ def cachedmethod(f, cache={}):
|
|||
return cache[key]
|
||||
|
||||
return _
|
||||
|
||||
def stackedmethod(f):
|
||||
def _(*args, **kwargs):
|
||||
threadData = getCurrentThreadData()
|
||||
originalLevel = len(threadData.valueStack)
|
||||
|
||||
try:
|
||||
result = f(*args, **kwargs)
|
||||
finally:
|
||||
if len(threadData.valueStack) > originalLevel:
|
||||
threadData.valueStack = threadData.valueStack[:originalLevel]
|
||||
|
||||
return result
|
||||
|
||||
return _
|
||||
Loading…
Add table
Add a link
Reference in a new issue