From f97c144869fa4cb8123d0a12ec9503ee0a8cf485 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Fri, 18 Mar 2011 09:38:51 +1300 Subject: Client playback shortcut in mitmproxy can now be used to interrupt a current client playback. --- libmproxy/console.py | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'libmproxy/console.py') diff --git a/libmproxy/console.py b/libmproxy/console.py index 78e81035..4c53ef01 100644 --- a/libmproxy/console.py +++ b/libmproxy/console.py @@ -1298,11 +1298,22 @@ class ConsoleMaster(flow.FlowMaster): if k == "?": self.view_help() elif k == "c": - self.path_prompt( - "Client replay: ", - self.state.last_saveload, - self.client_playback_path - ) + if not self.client_playback: + self.path_prompt( + "Client replay: ", + self.state.last_saveload, + self.client_playback_path + ) + else: + self.prompt_onekey( + "Stop current client replay?", + ( + ("yes", "y"), + ("no", "n"), + ), + self.stop_client_playback_prompt, + ) + k = None elif k == "l": self.prompt("Limit: ", self.state.limit_txt, self.set_limit) @@ -1384,6 +1395,10 @@ class ConsoleMaster(flow.FlowMaster): except (Stop, KeyboardInterrupt): pass + def stop_client_playback_prompt(self, a): + if a != "n": + self.stop_client_playback() + def quit(self, a): if a != "n": raise Stop -- cgit v1.2.3