Skip to content

Commit

Permalink
fix bug in #1430
Browse files Browse the repository at this point in the history
  • Loading branch information
zrquan committed Nov 13, 2024
1 parent f1a1d30 commit 4719e29
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions lib/controller/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,9 @@ def run(self) -> None:
self.requester = Requester()
if options["async_mode"]:
self.loop = asyncio.new_event_loop()
try:
self.loop.add_signal_handler(signal.SIGINT, self.handle_pause)
except NotImplementedError:
# Windows
signal.signal(signal.SIGINT, self.handle_pause)
signal.signal(signal.SIGTERM, self.handle_pause)

signal.signal(signal.SIGINT, lambda *_: self.handle_pause())
signal.signal(signal.SIGTERM, lambda *_: self.handle_pause())

while options["urls"]:
url = options["urls"][0]
Expand Down Expand Up @@ -514,18 +511,14 @@ def is_timed_out(self) -> bool:

def process(self) -> None:
while True:
try:
while not self.fuzzer.is_finished():
if self.is_timed_out():
raise SkipTargetInterrupt(
"Runtime exceeded the maximum set by the user"
)
time.sleep(0.5)

break
while not self.fuzzer.is_finished():
if self.is_timed_out():
raise SkipTargetInterrupt(
"Runtime exceeded the maximum set by the user"
)
time.sleep(0.5)

except KeyboardInterrupt:
self.handle_pause()
break

def add_directory(self, path: str) -> None:
"""Add directory to the recursion queue"""
Expand Down

0 comments on commit 4719e29

Please sign in to comment.