1. Preconfigure listener and start listener upon tunnel enabled logic are
invoked in two different threads.
2. There is a case where preconfigure logic is performed after the
pre-configured flag is computed in the enable-listener thread.
The current patch invalidates the flag in the start listener thread and
should guarantee the preconfigured status is up-to-date.
FileSystemUtils::saveTextFile(_listenerPreConfiguredPath, reason);
}
-
-
+bool CMonitorListener::isListenerPreConfigured() {
+ // Invalidate the flag
+ if (!_listenerPreConfigured) {
+ _listenerPreConfigured = FileSystemUtils::doesFileExist(_listenerPreConfiguredPath);
+ }
+ return _listenerPreConfigured;
+}
bool preConfigureListener();
- bool isListenerPreConfigured() {
- return _listenerPreConfigured;
- }
+ bool isListenerPreConfigured();
bool followTunnel(std::string& listenerStartupType);