Skip to content

Commit 0946169

Browse files
jpnurmiclaude
andcommitted
wip(envelope): add commented-out small .dmp condition for local testing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 0dd7412 commit 0946169

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

src/sentry_envelope.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,16 @@
1515

1616
#define SENTRY_LARGE_ATTACHMENT_SIZE (100 * 1024 * 1024) // 100 MB
1717

18+
static bool
19+
is_large_attachment(const sentry_path_t *path, size_t file_size)
20+
{
21+
// TODO: for temporarily testing with <1 MB minidumps
22+
// return file_size < 1024 * 1024 && sentry__path_ends_with(path, ".dmp");
23+
24+
(void)path;
25+
return file_size >= SENTRY_LARGE_ATTACHMENT_SIZE;
26+
}
27+
1828
struct sentry_envelope_item_s {
1929
sentry_value_t headers;
2030
sentry_value_t event;
@@ -760,7 +770,7 @@ sentry__envelope_add_attachment(
760770
: sentry__path_get_size(attachment->path);
761771

762772
sentry_envelope_item_t *item = NULL;
763-
if (file_size >= SENTRY_LARGE_ATTACHMENT_SIZE) {
773+
if (is_large_attachment(attachment->path, file_size)) {
764774
if (attachment->buf) {
765775
item = envelope_add_item(envelope);
766776
if (item) {
@@ -848,7 +858,7 @@ sentry__envelope_add_from_path(
848858
return NULL;
849859
}
850860
size_t file_size = sentry__path_get_size(path);
851-
if (file_size >= SENTRY_LARGE_ATTACHMENT_SIZE) {
861+
if (is_large_attachment(path, file_size)) {
852862
return envelope_add_attachment_ref(envelope, path, file_size, NULL);
853863
}
854864
size_t buf_len;

0 commit comments

Comments
 (0)