summaryrefslogtreecommitdiff
path: root/src/state_machine.hpp
diff options
context:
space:
mode:
authorAdrian Ambrożewicz <adrian.ambrozewicz@linux.intel.com>2020-04-03 14:20:58 +0300
committerAdrian Ambrożewicz <adrian.ambrozewicz@linux.intel.com>2020-04-03 16:00:04 +0300
commitbe44219f15d0dee68edb5fd9370f8bb76c71c71d (patch)
treee2fa277bb1dfeaa33b4657edd40409be2159ddb4 /src/state_machine.hpp
parent12dd8d9623726c6272f88b56a7dccf76e1304514 (diff)
downloadvirtual-media-be44219f15d0dee68edb5fd9370f8bb76c71c71d.tar.xz
Make 'Legacy mode' (mounting through HTTPS or SMB) configurable at compile time.
This change modifies the default configuration and removes ability to configure endpoints in such mode. Tests performed: Tested on WilsonCity for regression. Proxy mode works. Manual configuration injection (modifying virtual-media.json) didn't enable Legacy endpoints - they are ignored. Change-Id: Idb63f1cf0f391dc428d6ad3d8e3684017d509369 Signed-off-by: Adrian Ambrożewicz <adrian.ambrozewicz@linux.intel.com>
Diffstat (limited to 'src/state_machine.hpp')
-rw-r--r--src/state_machine.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/state_machine.hpp b/src/state_machine.hpp
index 388b79a..c0f331f 100644
--- a/src/state_machine.hpp
+++ b/src/state_machine.hpp
@@ -282,6 +282,15 @@ struct MountPointStateMachine
{
const bool isLegacy =
(state.machine.config.mode == Configuration::Mode::legacy);
+
+#if !LEGACY_MODE_ENABLED
+ if (isLegacy)
+ {
+ return ReadyState(state, std::errc::invalid_argument,
+ "Legacy mode is not supported");
+ }
+#endif
+
addMountPointInterface(state);
addProcessInterface(state);
addServiceInterface(state, isLegacy);