mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2025-12-26 01:19:04 +00:00
Trivial speedup
This commit is contained in:
@@ -154,7 +154,14 @@ def _comparison(page, headers, code, getRatioValue, pageLength):
|
||||
seqMatcher.set_seq1(seq1)
|
||||
seqMatcher.set_seq2(seq2)
|
||||
|
||||
ratio = round(seqMatcher.quick_ratio() if not kb.heavilyDynamic else seqMatcher.ratio(), 3)
|
||||
key = (hash(seq1), hash(seq2))
|
||||
|
||||
if key in kb.cache.comparison:
|
||||
ratio = kb.cache.comparison[key]
|
||||
else:
|
||||
ratio = round(seqMatcher.quick_ratio() if not kb.heavilyDynamic else seqMatcher.ratio(), 3)
|
||||
|
||||
kb.cache.comparison[key] = ratio
|
||||
|
||||
# If the url is stable and we did not set yet the match ratio and the
|
||||
# current injected value changes the url page content
|
||||
|
||||
@@ -126,6 +126,7 @@ from lib.core.settings import UNICODE_ENCODING
|
||||
from lib.core.settings import URI_HTTP_HEADER
|
||||
from lib.core.settings import WARN_TIME_STDEV
|
||||
from lib.core.settings import WEBSOCKET_INITIAL_TIMEOUT
|
||||
from lib.core.settings import YUGE_FACTOR
|
||||
from lib.request.basic import decodePage
|
||||
from lib.request.basic import forgeHeaders
|
||||
from lib.request.basic import processResponse
|
||||
@@ -253,7 +254,7 @@ class Connect(object):
|
||||
break
|
||||
|
||||
if conf.yuge:
|
||||
retVal = 100 * retVal
|
||||
retVal = YUGE_FACTOR * retVal
|
||||
|
||||
return retVal
|
||||
|
||||
|
||||
Reference in New Issue
Block a user