Make scripted rewriting of saved traffic work in mitmdump.

This commit is contained in:
Aldo Cortesi 2011-08-05 09:41:29 +12:00
parent be133e7a0b
commit ce48cb4deb

View File

@ -85,15 +85,6 @@ class DumpMaster(flow.FlowMaster):
not options.keepserving
)
if options.rfile:
path = os.path.expanduser(options.rfile)
try:
f = file(path, "r")
freader = flow.FlowReader(f)
except IOError, v:
raise DumpError(v.strerror)
self.load_flows(freader)
if options.client_replay:
self.start_client_playback(
self._readflow(options.client_replay),
@ -105,6 +96,16 @@ class DumpMaster(flow.FlowMaster):
if err:
raise DumpError(err)
if options.rfile:
path = os.path.expanduser(options.rfile)
try:
f = file(path, "r")
freader = flow.FlowReader(f)
except IOError, v:
raise DumpError(v.strerror)
self.load_flows(freader)
def _readflow(self, path):
path = os.path.expanduser(path)
try: