diff options
author | Gabriel Masei <gabriel.masei@1and1.ro> | 2019-10-07 14:51:30 +0300 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2019-10-08 18:57:36 +0200 |
commit | d597f22dac9042c3917d3b105adc810b6900d52c (patch) | |
tree | 28a16cd65230e97f324ea01206c41e8efc4a943b /wsd/LOOLWSD.hpp | |
parent | loleaflet: impress: add icon for inserting header and footer (diff) | |
download | online-d597f22dac9042c3917d3b105adc810b6900d52c.tar.gz online-d597f22dac9042c3917d3b105adc810b6900d52c.zip |
Add minimal TLS support for communication with storage
Change-Id: Iafd9946a4240063c07f5c519b8af30b52e23d3e8
Reviewed-on: https://gerrit.libreoffice.org/80373
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'wsd/LOOLWSD.hpp')
-rw-r--r-- | wsd/LOOLWSD.hpp | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/wsd/LOOLWSD.hpp b/wsd/LOOLWSD.hpp index 0253d08b2e..333a6afc17 100644 --- a/wsd/LOOLWSD.hpp +++ b/wsd/LOOLWSD.hpp @@ -130,6 +130,27 @@ public: return getConfigValue(Application::instance().config(), name, def); } + /// Reads and processes path entries with the given property + /// from the configuration. + /// Converts relative paths to absolute. + static + std::string getPathFromConfig(const std::string& name) + { + return getPathFromConfig(Application::instance().config(), name); + } + + /// Reads and processes path entries with the given property + /// from the configuration. If value is empty then it reads from fallback + /// Converts relative paths to absolute. + static + std::string getPathFromConfigWithFallback(const std::string& name, const std::string& fallbackName) + { + std::string value = LOOLWSD::getPathFromConfig(name); + if (value.empty()) + return LOOLWSD::getPathFromConfig(fallbackName); + return value; + } + /// Trace a new session and take a snapshot of the file. static void dumpNewSessionTrace(const std::string& id, const std::string& sessionId, const std::string& uri, const std::string& path); @@ -253,19 +274,20 @@ private: /// Reads and processes path entries with the given property /// from the configuration. /// Converts relative paths to absolute. - std::string getPathFromConfig(const std::string& property) const + static + std::string getPathFromConfig(Poco::Util::LayeredConfiguration& config, const std::string& property) { - std::string path = config().getString(property); - if (path.empty() && config().hasProperty(property + "[@default]")) + std::string path = config.getString(property); + if (path.empty() && config.hasProperty(property + "[@default]")) { // Use the default value if empty and a default provided. - path = config().getString(property + "[@default]"); + path = config.getString(property + "[@default]"); } // Reconstruct absolute path if relative. if (!Poco::Path(path).isAbsolute() && - config().hasProperty(property + "[@relative]") && - config().getBool(property + "[@relative]")) + config.hasProperty(property + "[@relative]") && + config.getBool(property + "[@relative]")) { path = Poco::Path(Application::instance().commandPath()).parent().append(path).toString(); } |