mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-30 03:14:22 +00:00
[sans-io] remove hook replies
Hooks should not have immediate replies. Instead, they should modify the object passed over the hook.
This commit is contained in:
parent
4a9cd7f36f
commit
967d48bdfa
@ -33,8 +33,9 @@ class ProxyConnectionHandler(server.ConnectionHandler):
|
|||||||
submit = lambda x: self.loop.call_soon_threadsafe(lambda: q.put_nowait(x))
|
submit = lambda x: self.loop.call_soon_threadsafe(lambda: q.put_nowait(x))
|
||||||
hook.data.reply = AsyncReply(submit, hook.data)
|
hook.data.reply = AsyncReply(submit, hook.data)
|
||||||
self.event_queue.put((hook.name, hook.data))
|
self.event_queue.put((hook.name, hook.data))
|
||||||
reply = await q.get()
|
await q.get()
|
||||||
self.server_event(events.HookReply(hook, reply))
|
if hook.blocking:
|
||||||
|
self.server_event(events.HookReply(hook, None))
|
||||||
|
|
||||||
def _debug(self, *args):
|
def _debug(self, *args):
|
||||||
x = log.LogEntry(" ".join(str(x) for x in args), "warn")
|
x = log.LogEntry(" ".join(str(x) for x in args), "warn")
|
||||||
|
Loading…
Reference in New Issue
Block a user