Skip to content

Commit eeacab0

Browse files
committed
Speedup of caching for char encoding (non-Unicode chars in page)
1 parent b3e454d commit eeacab0

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

lib/core/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from thirdparty.six import unichr as _unichr
1919

2020
# sqlmap version (<major>.<minor>.<month>.<monthly commit>)
21-
VERSION = "1.5.2.26"
21+
VERSION = "1.5.3.0"
2222
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
2323
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
2424
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)

lib/parse/cmdline.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,9 @@ def cmdLineParser(argv=None):
773773
parser.add_argument("--dummy", dest="dummy", action="store_true",
774774
help=SUPPRESS)
775775

776+
parser.add_argument("--yuge", dest="yuge", action="store_true",
777+
help=SUPPRESS)
778+
776779
parser.add_argument("--murphy-rate", dest="murphyRate", type=int,
777780
help=SUPPRESS)
778781

lib/request/basic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def getHeuristicCharEncoding(page):
259259
"""
260260

261261
key = hash(page)
262-
retVal = kb.cache.encoding.get(key) or detect(page[:HEURISTIC_PAGE_SIZE_THRESHOLD])["encoding"]
262+
retVal = kb.cache.encoding[key] if key in kb.cache.encoding else detect(page[:HEURISTIC_PAGE_SIZE_THRESHOLD])["encoding"]
263263
kb.cache.encoding[key] = retVal
264264

265265
if retVal and retVal.lower().replace('-', "") == UNICODE_ENCODING.lower().replace('-', ""):

lib/request/connect.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,9 @@ def _connReadProxy(conn):
252252
singleTimeWarnMessage(warnMsg)
253253
break
254254

255+
if conf.yuge:
256+
retVal = 100 * retVal
257+
255258
return retVal
256259

257260
@staticmethod

0 commit comments

Comments
 (0)