aboutsummaryrefslogtreecommitdiffstats
path: root/mitmproxy/command.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2018-04-04 14:52:24 +1200
committerAldo Cortesi <aldo@corte.si>2018-04-07 09:04:14 +1200
commit9dcd15d350aa5e2ee2d6f7299d0183cabddeb992 (patch)
treeb02a58edf7402c3f0f9a898a71d9e384bea4ecf2 /mitmproxy/command.py
parent6a08ef465f3af6cb2044baf98279de1071538f5a (diff)
downloadmitmproxy-9dcd15d350aa5e2ee2d6f7299d0183cabddeb992.tar.gz
mitmproxy-9dcd15d350aa5e2ee2d6f7299d0183cabddeb992.tar.bz2
mitmproxy-9dcd15d350aa5e2ee2d6f7299d0183cabddeb992.zip
asyncio: ditch the handler context
There are a few reasons for this. First, logs are now async, and can be called at any time. Second, the event loop is thread local, so there can only ever be one master per thread. These two things together completely obviate the need for a handler context.
Diffstat (limited to 'mitmproxy/command.py')
-rw-r--r--mitmproxy/command.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/mitmproxy/command.py b/mitmproxy/command.py
index 114e882d..35a7f42a 100644
--- a/mitmproxy/command.py
+++ b/mitmproxy/command.py
@@ -95,11 +95,7 @@ class Command:
Call the command with a list of arguments. At this point, all
arguments are strings.
"""
- pargs = self.prepare_args(args)
-
- with self.manager.master.handlecontext():
- ret = self.func(*pargs)
-
+ ret = self.func(*self.prepare_args(args))
if ret is None and self.returntype is None:
return
typ = mitmproxy.types.CommandTypes.get(self.returntype)