From 30213d6370bca2bb222e315a63bf4d924a9b0b94 Mon Sep 17 00:00:00 2001 From: Marcelo Glezer Date: Tue, 6 Jan 2015 15:49:49 -0300 Subject: now mitmproxy supports multiple saved flows files too. also fixed server_play_back start with mitmproxy (missing parameter) --- libmproxy/console/__init__.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'libmproxy/console/__init__.py') diff --git a/libmproxy/console/__init__.py b/libmproxy/console/__init__.py index f5b6a2a6..e2a0ec75 100644 --- a/libmproxy/console/__init__.py +++ b/libmproxy/console/__init__.py @@ -496,11 +496,13 @@ class ConsoleMaster(flow.FlowMaster): self.eventlog = not self.eventlog self.view_flowlist() - def _readflow(self, path): - path = os.path.expanduser(path) + def _readflow(self, paths): try: - f = file(path, "rb") - flows = list(flow.FlowReader(f).stream()) + flows = [] + for path in paths: + path = os.path.expanduser(path) + f = file(path, "rb") + flows.extend(list(flow.FlowReader(f).stream())) except (IOError, flow.FlowReadError), v: return True, v.strerror return False, flows @@ -521,7 +523,7 @@ class ConsoleMaster(flow.FlowMaster): ret, self.killextra, self.rheaders, False, self.nopop, - self.options.replay_ignore_params, self.options.replay_ignore_content + self.options.replay_ignore_params, self.options.replay_ignore_content, self.options.replay_ignore_payload_params ) def spawn_editor(self, data): -- cgit v1.2.3 From 4f578866fac9e8261ad659d9a04c87822d7c9aab Mon Sep 17 00:00:00 2001 From: Marcelo Glezer Date: Mon, 12 Jan 2015 14:31:18 -0300 Subject: open flow files using with as max suggested --- libmproxy/console/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libmproxy/console/__init__.py') diff --git a/libmproxy/console/__init__.py b/libmproxy/console/__init__.py index b2f4d96c..559c78d4 100644 --- a/libmproxy/console/__init__.py +++ b/libmproxy/console/__init__.py @@ -501,8 +501,8 @@ class ConsoleMaster(flow.FlowMaster): flows = [] for path in paths: path = os.path.expanduser(path) - f = file(path, "rb") - flows.extend(list(flow.FlowReader(f).stream())) + with file(path, "rb") as f: + flows.extend(list(flow.FlowReader(f).stream())) except (IOError, flow.FlowReadError), v: return True, v.strerror return False, flows -- cgit v1.2.3