diff --git a/CHANGELOG.md b/CHANGELOG.md index bb0c31af4..f43a8014c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - Disable PC adjustment in the backend for libunwindstack ([#839](https://github.com/getsentry/sentry-native/pull/839)) - Crashpad backend allows inspection and enrichment of the crash event in the on_crash/before_send hooks ([#843](https://github.com/getsentry/sentry-native/pull/843)) +- Add http-proxy support to the `crashpad_handler` ([#847](https://github.com/getsentry/sentry-native/pull/847), [crashpad#86](https://github.com/getsentry/crashpad/pull/86)) **Internal**: diff --git a/external/crashpad b/external/crashpad index 1904ae143..704134973 160000 --- a/external/crashpad +++ b/external/crashpad @@ -1 +1 @@ -Subproject commit 1904ae14360bb3115e098950733a4fd3da93b25a +Subproject commit 7041349732770d0902e156deaba6e86bfdee1a0a diff --git a/src/backends/sentry_backend_crashpad.cpp b/src/backends/sentry_backend_crashpad.cpp index ddb93f2ca..b3bc19440 100644 --- a/src/backends/sentry_backend_crashpad.cpp +++ b/src/backends/sentry_backend_crashpad.cpp @@ -319,15 +319,25 @@ crashpad_backend_startup( // `sentry_init` will persist the upload flag. data->db = crashpad::CrashReportDatabase::Initialize(database).release(); + bool success; crashpad::CrashpadClient client; char *minidump_url = sentry__dsn_get_minidump_url(options->dsn, options->user_agent); - SENTRY_TRACEF("using minidump url \"%s\"", minidump_url); - std::string url = minidump_url ? std::string(minidump_url) : std::string(); - sentry_free(minidump_url); - bool success = client.StartHandler(handler, database, database, url, - annotations, arguments, /* restartable */ true, - /* asynchronous_start */ false, attachments); + if (minidump_url) { + SENTRY_TRACEF("using minidump URL \"%s\"", minidump_url); + success = client.StartHandler(handler, database, database, minidump_url, + options->http_proxy ? options->http_proxy : "", annotations, + arguments, + /* restartable */ true, + /* asynchronous_start */ false, attachments); + sentry_free(minidump_url); + } else { + SENTRY_WARN( + "failed to construct minidump URL (check DSN or user-agent)"); + delete data->db; + data->db = nullptr; + return 1; + } #ifdef CRASHPAD_WER_ENABLED sentry_path_t *handler_dir = sentry__path_dir(absolute_handler_path);