From 7076d5d80457171ffea89045a98f0a57b09c3187 Mon Sep 17 00:00:00 2001 From: 4shen0ne <4shen.01@gmail.com> Date: Fri, 13 Sep 2024 16:27:21 +0800 Subject: [PATCH] ignore some features in async mode --- lib/controller/controller.py | 8 ++++++++ lib/core/options.py | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/lib/controller/controller.py b/lib/controller/controller.py index f7b446c75..4fe4759e9 100755 --- a/lib/controller/controller.py +++ b/lib/controller/controller.py @@ -564,6 +564,14 @@ def handle_pause(self): option = input() if option.lower() == "q": + if options["async_mode"]: + quitexc = QuitInterrupt("Canceled by the user") + if options["async_mode"]: + self.pause_future.set_exception(quitexc) + break + else: + raise quitexc + interface.in_line("[s]ave / [q]uit without saving: ") option = input() diff --git a/lib/core/options.py b/lib/core/options.py index 0ebde0d2d..c541d3f0c 100755 --- a/lib/core/options.py +++ b/lib/core/options.py @@ -35,6 +35,9 @@ def parse_options(): opt = parse_config(parse_arguments()) if opt.session_file: + if opt.async_mode: + print("Cannot resume a session in asynchronous mode") + exit(1) return vars(opt) opt.http_method = opt.http_method.upper() @@ -200,6 +203,9 @@ def parse_options(): ) exit(1) + if opt.async_mode and opt.replay_proxy: + print("WARNING: --replay-proxy doesn't work in asynchronous mode") + return vars(opt)