This commit is contained in:
Miroslav Stampar 2016-03-10 14:48:05 +01:00
parent c50849707f
commit 3307918389
3 changed files with 8 additions and 3 deletions

View File

@ -2917,7 +2917,7 @@ def showHttpErrorCodes():
msg += "could mean that some kind of protection is involved (e.g. WAF)" msg += "could mean that some kind of protection is involved (e.g. WAF)"
logger.debug(msg) logger.debug(msg)
def openFile(filename, mode='r', encoding=UNICODE_ENCODING, errors="replace", buffering=1): def openFile(filename, mode='r', encoding=UNICODE_ENCODING, errors="replace", buffering=1): # "buffering=1" means line buffered (Reference: http://stackoverflow.com/a/3168436)
""" """
Returns file handle of a given filename Returns file handle of a given filename
""" """

View File

@ -37,6 +37,7 @@ from lib.core.exception import SqlmapGenericException
from lib.core.exception import SqlmapValueException from lib.core.exception import SqlmapValueException
from lib.core.exception import SqlmapSystemException from lib.core.exception import SqlmapSystemException
from lib.core.replication import Replication from lib.core.replication import Replication
from lib.core.settings import DUMP_FILE_BUFFER_SIZE
from lib.core.settings import HTML_DUMP_CSS_STYLE from lib.core.settings import HTML_DUMP_CSS_STYLE
from lib.core.settings import IS_WIN from lib.core.settings import IS_WIN
from lib.core.settings import METADB_SUFFIX from lib.core.settings import METADB_SUFFIX
@ -449,7 +450,7 @@ class Dump(object):
dumpFileName = os.path.join(dumpDbPath, "%s.%s" % (_, conf.dumpFormat.lower())) dumpFileName = os.path.join(dumpDbPath, "%s.%s" % (_, conf.dumpFormat.lower()))
appendToFile = os.path.isfile(dumpFileName) and any((conf.limitStart, conf.limitStop)) appendToFile = os.path.isfile(dumpFileName) and any((conf.limitStart, conf.limitStop))
dumpFP = openFile(dumpFileName, "wb" if not appendToFile else "ab") dumpFP = openFile(dumpFileName, "wb" if not appendToFile else "ab", buffering=DUMP_FILE_BUFFER_SIZE)
count = int(tableValues["__infos__"]["count"]) count = int(tableValues["__infos__"]["count"])
separator = str() separator = str()

View File

@ -20,7 +20,7 @@ from lib.core.enums import OS
from lib.core.revision import getRevisionNumber from lib.core.revision import getRevisionNumber
# sqlmap version and site # sqlmap version and site
VERSION = "1.0.0.15" VERSION = "1.0.0.16"
REVISION = getRevisionNumber() REVISION = getRevisionNumber()
STABLE = VERSION.count('.') <= 2 STABLE = VERSION.count('.') <= 2
VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev") VERSION_STRING = "sqlmap/%s#%s" % (VERSION, "stable" if STABLE else "dev")
@ -483,6 +483,10 @@ SOCKET_PRE_CONNECT_QUEUE_SIZE = 3
# Only console display last n table rows # Only console display last n table rows
TRIM_STDOUT_DUMP_SIZE = 256 TRIM_STDOUT_DUMP_SIZE = 256
# Reference: http://stackoverflow.com/a/3168436
# Reference: https://support.microsoft.com/en-us/kb/899149
DUMP_FILE_BUFFER_SIZE = 1024
# Parse response headers only first couple of times # Parse response headers only first couple of times
PARSE_HEADERS_LIMIT = 3 PARSE_HEADERS_LIMIT = 3