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

Skip to content

Commit d461089

Browse files
committed
Minor patch (flushing log file output at the end of program run)
1 parent 7811a95 commit d461089

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

lib/core/dump.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ def _write(self, data, newline=True, console=True, content_type=None):
7373

7474
kb.dataOutputFlag = True
7575

76+
def flush(self):
77+
if self._outputFP:
78+
try:
79+
self._outputFP.flush()
80+
except IOError:
81+
pass
82+
7683
def setOutputFile(self):
7784
self._outputFile = os.path.join(conf.outputPath, "log")
7885
try:

sqlmap.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ def main():
156156
except KeyboardInterrupt:
157157
pass
158158

159+
if conf.get("dumper"):
160+
conf.dumper.flush()
161+
159162
# Reference: http://stackoverflow.com/questions/1635080/terminate-a-multi-thread-python-program
160163
if conf.get("threads", 0) > 1 or conf.get("dnsServer"):
161164
os._exit(0)

0 commit comments

Comments
 (0)