05nelsonm / kmp-tor

Kotlin Multiplatform Library for embedding Tor into your applications
Apache License 2.0
33 stars 5 forks source link

Improper state if cancelled jobs on stack and start fails #402

Closed 05nelsonm closed 4 months ago

05nelsonm commented 4 months ago

Currently, an invokeOnCompletion handle is used to enqueue StopJob upon a StartJob or RestartJob failure. This occurs only if the actionStack is empty. This is incorrect, as there could be jobs on the stack that are cancelled and will not be executed, leaving things in an improper state. A local variable should be utilized to pass to processStack indicating that the last startup action had failed, such that if nothing is on the stack after being processed, then to execute StopJob instead of stopping the processor.