summaryrefslogtreecommitdiff
path: root/desktop/source/app
diff options
context:
space:
mode:
authorAron Budea <aron.budea@collabora.com>2018-03-19 23:56:54 +0100
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-05-16 10:46:08 +0200
commit07174b62c6ee23f7b44742ecfe44d4ff8653e57f (patch)
tree9fabe0d3b8a12b44cfd9ec1efefcb626c3a3c4af /desktop/source/app
parent71f89889b5bf6273067acb4dad925a5c5ecb3239 (diff)
tdf#114227: set better proxy params in cURL for crash reporting
Take proxy server from internet settings, and pass to cURL. Allow forwarding authentication as well (explicitely setting user/password is still missing). Change-Id: I19a6c9057a11a5911a6117f71060d3f386953602 Reviewed-on: https://gerrit.libreoffice.org/51621 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'desktop/source/app')
-rw-r--r--desktop/source/app/crashreport.cxx19
1 files changed, 18 insertions, 1 deletions
diff --git a/desktop/source/app/crashreport.cxx b/desktop/source/app/crashreport.cxx
index 24205e8b2b8b..29001367bb91 100644
--- a/desktop/source/app/crashreport.cxx
+++ b/desktop/source/app/crashreport.cxx
@@ -10,6 +10,8 @@
#include <desktop/crashreport.hxx>
#include <rtl/bootstrap.hxx>
#include <osl/file.hxx>
+#include <comphelper/processfactory.hxx>
+#include <ucbhelper/proxydecider.hxx>
#include <unotools/bootstrap.hxx>
#include <o3tl/char16_t2wchar_t.hxx>
@@ -70,13 +72,28 @@ void CrashReporter::AddKeyValue(const OUString& rKey, const OUString& rValue)
void CrashReporter::writeCommonInfo()
{
osl::MutexGuard aGuard(maMutex);
+
+ ucbhelper::InternetProxyDecider proxy_decider(::comphelper::getProcessComponentContext());
+
+ const OUString protocol = "https";
+ const OUString url = "crashreport.libreoffice.org";
+ const sal_Int32 port = 443;
+
+ const ucbhelper::InternetProxyServer proxy_server = proxy_decider.getProxy(protocol, url, port);
+
// limit the amount of code that needs to be executed before the crash reporting
std::string ini_path = CrashReporter::getIniFileName();
std::ofstream minidump_file(ini_path, std::ios_base::trunc);
minidump_file << "ProductName=LibreOffice\n";
minidump_file << "Version=" LIBO_VERSION_DOTTED "\n";
minidump_file << "BuildID=" << utl::Bootstrap::getBuildIdData("") << "\n";
- minidump_file << "URL=https://crashreport.libreoffice.org/submit/\n";
+ minidump_file << "URL=" << protocol << "://" << url << "/submit/\n";
+
+ if (proxy_server.aName != OUString())
+ {
+ minidump_file << "Proxy=" << proxy_server.aName << ":" << proxy_server.nPort << "\n";
+ }
+
for (auto& keyValue : maKeyValues)
{
writeToStream(minidump_file, keyValue.first, keyValue.second);