diff options
author | Adrian Ambrożewicz <adrian.ambrozewicz@linux.intel.com> | 2020-04-03 14:20:58 +0300 |
---|---|---|
committer | Adrian Ambrożewicz <adrian.ambrozewicz@linux.intel.com> | 2020-04-03 16:00:04 +0300 |
commit | be44219f15d0dee68edb5fd9370f8bb76c71c71d (patch) | |
tree | e2fa277bb1dfeaa33b4657edd40409be2159ddb4 /src | |
parent | 12dd8d9623726c6272f88b56a7dccf76e1304514 (diff) | |
download | virtual-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')
-rw-r--r-- | src/configuration.hpp | 2 | ||||
-rw-r--r-- | src/state_machine.hpp | 9 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/configuration.hpp b/src/configuration.hpp index 89c9d02..99dbec1 100644 --- a/src/configuration.hpp +++ b/src/configuration.hpp @@ -209,10 +209,12 @@ class Configuration { mp.mode = Configuration::Mode::proxy; } +#if LEGACY_MODE_ENABLED else if (*value == 1) { mp.mode = Configuration::Mode::legacy; } +#endif else { LogMsg(Logger::Error, 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); |