Skip to content

Commit 0f5846e

Browse files
committed
improve format
1 parent 1b326bd commit 0f5846e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ endif()
5555

5656
option(SENTRY_PIC "Build sentry (and dependent) libraries as position independent libraries" ON)
5757

58-
option(SENTRY_TRANSPORT_COMPRESSION " Enable transport gzip compression" OFF)
58+
option(SENTRY_TRANSPORT_COMPRESSION "Enable transport gzip compression" OFF)
5959

6060
option(SENTRY_BUILD_TESTS "Build sentry-native tests" "${SENTRY_MAIN_PROJECT}")
6161
option(SENTRY_BUILD_EXAMPLES "Build sentry-native example(s)" "${SENTRY_MAIN_PROJECT}")
@@ -299,8 +299,7 @@ if(SENTRY_TRANSPORT_COMPRESSION)
299299
endif()
300300

301301
target_link_libraries(sentry PRIVATE ZLIB::ZLIB)
302-
303-
add_definitions(-DGZIP_COMPRESSION)
302+
add_definitions(-DSENTRY_GZIPPED_COMPRESSION)
304303
endif()
305304

306305
set_property(TARGET sentry PROPERTY C_VISIBILITY_PRESET hidden)

src/sentry_transport.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
#include "sentry_ratelimiter.h"
66
#include "sentry_string.h"
77

8-
#ifdef GZIP_COMPRESSION
8+
#ifdef SENTRY_GZIPPED_COMPRESSION
99
#include "zlib.h"
1010
#endif
1111

1212
#define ENVELOPE_MIME "application/x-sentry-envelope"
13-
// The headers we use are: `x-sentry-auth`, `content-type`, `content-encoding`, `content-length`
13+
// The headers we use are: `x-sentry-auth`, `content-type`, `content-encoding`,
14+
// `content-length`
1415
#define MAX_HTTP_HEADERS 4
1516

1617
typedef struct sentry_transport_s {
@@ -152,7 +153,7 @@ sentry_transport_free(sentry_transport_t *transport)
152153
sentry_free(transport);
153154
}
154155

155-
#ifdef GZIP_COMPRESSION
156+
#ifdef SENTRY_GZIPPED_COMPRESSION
156157
static bool
157158
gzipped_with_compression(const char *body, const size_t body_len,
158159
char **compressed_body, size_t *compressed_body_len)
@@ -220,7 +221,7 @@ sentry__prepare_http_request(sentry_envelope_t *envelope,
220221
}
221222

222223
bool compressed = false;
223-
#ifdef GZIP_COMPRESSION
224+
#ifdef SENTRY_GZIPPED_COMPRESSION
224225
char *compressed_body = NULL;
225226
size_t compressed_body_len = 0;
226227
compressed = gzipped_with_compression(

0 commit comments

Comments
 (0)