Agent: Invoke reactor.stop() with reactor.callFromThread()

This commit is contained in:
Mike Salvatore 2022-01-12 10:53:10 -05:00
parent 7fae22e993
commit b72ad39aa6
1 changed files with 4 additions and 1 deletions

View File

@ -89,4 +89,7 @@ class LDAPExploitServer:
reactor.run(installSignalHandlers=0)
def stop(self):
reactor.stop()
# Since `reactor.run()` may not be running on the main thread, reactor.stop() must be
# invoked with reactor.callFromThread()
# https://twistedmatrix.com/documents/12.2.0/core/howto/threading.html
reactor.callFromThread(reactor.stop)