Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3307918

Browse files
committed
Fixes #1750
1 parent c508497 commit 3307918

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

lib/core/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2917,7 +2917,7 @@ def showHttpErrorCodes():
29172917
msg += "could mean that some kind of protection is involved (e.g. WAF)"
29182918
logger.debug(msg)
29192919

2920-
def openFile(filename, mode='r', encoding=UNICODE_ENCODING, errors="replace", buffering=1):
2920+
def openFile(filename, mode='r', encoding=UNICODE_ENCODING, errors="replace", buffering=1): # "buffering=1" means line buffered (Reference: http://stackoverflow.com/a/3168436)
29212921
"""
29222922
Returns file handle of a given filename
29232923
"""

lib/core/dump.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
from lib.core.exception import SqlmapValueException
3838
from lib.core.exception import SqlmapSystemException
3939
from lib.core.replication import Replication
40+
from lib.core.settings import DUMP_FILE_BUFFER_SIZE
4041
from lib.core.settings import HTML_DUMP_CSS_STYLE
4142
from lib.core.settings import IS_WIN
4243
from lib.core.settings import METADB_SUFFIX
@@ -449,7 +450,7 @@ def dbTableValues(self, tableValues):
449450
dumpFileName = os.path.join(dumpDbPath, "%s.%s" % (_, conf.dumpFormat.lower()))
450451

451452
appendToFile = os.path.isfile(dumpFileName) and any((conf.limitStart, conf.limitStop))
452-
dumpFP = openFile(dumpFileName, "wb" if not appendToFile else "ab")
453+
dumpFP = openFile(dumpFileName, "wb" if not appendToFile else "ab", buffering=DUMP_FILE_BUFFER_SIZE)
453454

454455
count = int(tableValues["__infos__"]["count"])
455456
separator = str()

lib/core/settings.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from lib.core.revision import getRevisionNumber
2121

2222
# sqlmap version and site
23-
VERSION = "1.0.0.15"
23+
VERSION = "1.0.0.16"
2424
REVISION = getRevisionNumber()
2525
STABLE = VERSION.count('.') <= 2
2626
VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev")
@@ -483,6 +483,10 @@
483483
# Only console display last n table rows
484484
TRIM_STDOUT_DUMP_SIZE = 256
485485

486+
# Reference: http://stackoverflow.com/a/3168436
487+
# Reference: https://support.microsoft.com/en-us/kb/899149
488+
DUMP_FILE_BUFFER_SIZE = 1024
489+
486490
# Parse response headers only first couple of times
487491
PARSE_HEADERS_LIMIT = 3
488492

0 commit comments

Comments
 (0)