mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-26 02:10:59 +00:00
commit
2c85b262d5
@ -3,7 +3,6 @@ import mimetypes
|
|||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
import shlex
|
import shlex
|
||||||
import signal
|
|
||||||
import stat
|
import stat
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
@ -256,7 +255,6 @@ class ConsoleMaster(master.Master):
|
|||||||
changed = self.tick(timeout=0)
|
changed = self.tick(timeout=0)
|
||||||
if changed:
|
if changed:
|
||||||
self.loop.draw_screen()
|
self.loop.draw_screen()
|
||||||
signals.update_settings.send()
|
|
||||||
self.loop.set_alarm_in(0.01, self.ticker)
|
self.loop.set_alarm_in(0.01, self.ticker)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
@ -293,13 +291,6 @@ class ConsoleMaster(master.Master):
|
|||||||
)
|
)
|
||||||
self.loop.set_alarm_in(0.01, http2err)
|
self.loop.set_alarm_in(0.01, http2err)
|
||||||
|
|
||||||
# It's not clear why we need to handle this explicitly - without this,
|
|
||||||
# mitmproxy hangs on keyboard interrupt. Remove if we ever figure it
|
|
||||||
# out.
|
|
||||||
def exit(s, f):
|
|
||||||
raise urwid.ExitMainLoop
|
|
||||||
signal.signal(signal.SIGINT, exit)
|
|
||||||
|
|
||||||
self.loop.set_alarm_in(
|
self.loop.set_alarm_in(
|
||||||
0.0001,
|
0.0001,
|
||||||
lambda *args: self.view_flowlist()
|
lambda *args: self.view_flowlist()
|
||||||
@ -316,6 +307,7 @@ class ConsoleMaster(master.Master):
|
|||||||
print("Please lodge a bug report at:", file=sys.stderr)
|
print("Please lodge a bug report at:", file=sys.stderr)
|
||||||
print("\thttps://github.com/mitmproxy/mitmproxy", file=sys.stderr)
|
print("\thttps://github.com/mitmproxy/mitmproxy", file=sys.stderr)
|
||||||
print("Shutting down...", file=sys.stderr)
|
print("Shutting down...", file=sys.stderr)
|
||||||
|
finally:
|
||||||
sys.stderr.flush()
|
sys.stderr.flush()
|
||||||
self.shutdown()
|
self.shutdown()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user