Skip to content

Commit

Permalink
feat: crashpad handler http-proxy support (#847)
Browse files Browse the repository at this point in the history
  • Loading branch information
supervacuus authored May 27, 2023
1 parent 6c76f58 commit ad3c988
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**:

Expand Down
22 changes: 16 additions & 6 deletions src/backends/sentry_backend_crashpad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ad3c988

Please sign in to comment.