diff options
Diffstat (limited to 'desktop/source/app/crashreport.cxx')
-rw-r--r-- | desktop/source/app/crashreport.cxx | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/desktop/source/app/crashreport.cxx b/desktop/source/app/crashreport.cxx index 18db12d07b38..b8d3a9400b29 100644 --- a/desktop/source/app/crashreport.cxx +++ b/desktop/source/app/crashreport.cxx @@ -131,9 +131,21 @@ void CrashReporter::writeCommonInfo() ucbhelper::InternetProxyDecider proxy_decider(::comphelper::getProcessComponentContext()); static constexpr OUString protocol = u"https"_ustr; - static constexpr OUString url = u"crashreport.libreoffice.org"_ustr; const sal_Int32 port = 443; + // read configuration item 'CrashDumpUrl' + OUString url; + rtl::Bootstrap::get("CrashDumpUrl", url); + if (url.isEmpty()) + { + // no url in config, bail out, but still set proper crash + // directory for local dump generation (in case + // CrashDumpEnable is on + updateMinidumpLocation(); + mbInit = false; + return; + } + const OUString proxy_server = proxy_decider.getProxy(protocol, url, port); // save the new Keys @@ -269,6 +281,12 @@ void CrashReporter::removeExceptionHandler() bool CrashReporter::IsDumpEnable() { + static bool bConfigRead = false; + static bool bEnable = true; // default, always on + + if (bConfigRead) + return bEnable; + auto const env = std::getenv("CRASH_DUMP_ENABLE"); if (env != nullptr && env[0] != '\0') { return true; @@ -277,9 +295,11 @@ bool CrashReporter::IsDumpEnable() OUString sToken; if (rtl::Bootstrap::get("CrashDumpEnable", sToken)) { - return sToken.toBoolean(); + bEnable = sToken.toBoolean(); } - return true; // default, always on + + bConfigRead = true; + return bEnable; } |