Skip to content

Commit

Permalink
Reduce loop timeouts to improve mitmproxy responsiveness
Browse files Browse the repository at this point in the history
  • Loading branch information
cortesi committed Nov 5, 2014
1 parent 0fe83ce commit a2a8769
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libmproxy/console/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ def loop(self):
self.statusbar.redraw()
size = self.drawscreen()
changed = self.tick(self.masterq, 0.01)
self.ui.set_input_timeouts(max_wait=0.1)
self.ui.set_input_timeouts(max_wait=0.01)
keys = self.ui.get_input()
if keys:
changed = True
Expand Down
13 changes: 10 additions & 3 deletions libmproxy/flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,12 @@ def add(self, app, domain, port):
Add a WSGI app to the registry, to be served for requests to the
specified domain, on the specified port.
"""
self.apps[(domain, port)] = wsgi.WSGIAdaptor(app, domain, port, version.NAMEVERSION)
self.apps[(domain, port)] = wsgi.WSGIAdaptor(
app,
domain,
port,
version.NAMEVERSION
)

def get(self, request):
"""
Expand Down Expand Up @@ -72,7 +77,8 @@ def add(self, fpatt, rex, s):

def get_specs(self):
"""
Retrieve the hook specifcations. Returns a list of (fpatt, rex, s) tuples.
Retrieve the hook specifcations. Returns a list of (fpatt, rex, s)
tuples.
"""
return [i[:3] for i in self.lst]

Expand Down Expand Up @@ -119,7 +125,8 @@ def add(self, fpatt, header, value):

def get_specs(self):
"""
Retrieve the hook specifcations. Returns a list of (fpatt, rex, s) tuples.
Retrieve the hook specifcations. Returns a list of (fpatt, rex, s)
tuples.
"""
return [i[:3] for i in self.lst]

Expand Down

0 comments on commit a2a8769

Please sign in to comment.