aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy/console
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-02-19 13:16:21 +1300
committerAldo Cortesi <aldo@nullcube.com>2012-02-19 13:16:21 +1300
commit86a19faf6859e1f971ccccba3dabe596531636e9 (patch)
tree8254dc06f85839e26cba0baaf84a2f392a84e4d1 /libmproxy/console
parent9113277cd39e2cb66e3758db0039759cf4287766 (diff)
downloadmitmproxy-86a19faf6859e1f971ccccba3dabe596531636e9.tar.gz
mitmproxy-86a19faf6859e1f971ccccba3dabe596531636e9.tar.bz2
mitmproxy-86a19faf6859e1f971ccccba3dabe596531636e9.zip
Fix crash when setting a limit when there are no flows.
Diffstat (limited to 'libmproxy/console')
-rw-r--r--libmproxy/console/connlist.py24
1 files changed, 11 insertions, 13 deletions
diff --git a/libmproxy/console/connlist.py b/libmproxy/console/connlist.py
index f54b8061..f5af2ca2 100644
--- a/libmproxy/console/connlist.py
+++ b/libmproxy/console/connlist.py
@@ -106,15 +106,6 @@ class ConnectionItem(common.WWrap):
f = self.master.duplicate_flow(self.flow)
self.master.currentflow = f
self.master.focus_current()
- elif key == "l":
- self.master.prompt("Limit: ", self.state.limit_txt, self.master.set_limit)
- self.master.sync_list_view()
- elif key == "L":
- self.master.path_prompt(
- "Load flows: ",
- self.state.last_saveload,
- self.master.load_flows_callback
- )
elif key == "r":
r = self.master.replay_request(self.flow)
if r:
@@ -189,11 +180,18 @@ class ConnectionListBox(urwid.ListBox):
if key == "A":
self.master.accept_all()
self.master.sync_list_view()
- key = None
elif key == "C":
self.master.clear_connections()
- key = None
elif key == "e":
self.master.toggle_eventlog()
- key = None
- return urwid.ListBox.keypress(self, size, key)
+ elif key == "l":
+ self.master.prompt("Limit: ", self.master.state.limit_txt, self.master.set_limit)
+ self.master.sync_list_view()
+ elif key == "L":
+ self.master.path_prompt(
+ "Load flows: ",
+ self.master.state.last_saveload,
+ self.master.load_flows_callback
+ )
+ else:
+ return urwid.ListBox.keypress(self, size, key)