mirror of
https://github.com/vee1e/mitmproxy.git
synced 2026-09-03 19:27:14 +00:00
script: tweak explicit command invocation
This commit is contained in:
parent
33eba29d1e
commit
94428b2ffd
2 changed files with 5 additions and 8 deletions
|
|
@ -155,9 +155,9 @@ class ScriptLoader:
|
|||
if not os.path.isfile(path):
|
||||
ctx.log.error('No such script: %s' % path)
|
||||
return
|
||||
try:
|
||||
mod = load_script(path)
|
||||
if mod:
|
||||
mod = load_script(path)
|
||||
if mod:
|
||||
with addonmanager.safecall():
|
||||
ctx.master.addons.invoke_addon(mod, "running")
|
||||
ctx.master.addons.invoke_addon(
|
||||
mod,
|
||||
|
|
@ -166,10 +166,7 @@ class ScriptLoader:
|
|||
)
|
||||
for f in flows:
|
||||
for evt, arg in eventsequence.iterate(f):
|
||||
with addonmanager.safecall():
|
||||
ctx.master.addons.invoke_addon(mod, evt, arg)
|
||||
except exceptions.OptionsError as e:
|
||||
script_error_handler(path, e, msg=str(e))
|
||||
ctx.master.addons.invoke_addon(mod, evt, arg)
|
||||
|
||||
def configure(self, updated):
|
||||
if "scripts" in updated:
|
||||
|
|
|
|||
|
|
@ -586,7 +586,7 @@ class TCPServer:
|
|||
with self.handler_counter:
|
||||
try:
|
||||
self.handle_client_connection(connection, client_address)
|
||||
except OSError as e:
|
||||
except OSError as e: # pragma: no cover
|
||||
# This catches situations where the underlying connection is
|
||||
# closed beneath us. Syscalls on the connection object at this
|
||||
# point returns EINVAL. If this happens, we close the socket and
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue