Skip to content

Commit

Permalink
Clang format
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmundell authored and timopollmeier committed Jan 9, 2024
1 parent 2cf505d commit 2eb2ba1
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions src/gsad.c
Original file line number Diff line number Diff line change
Expand Up @@ -1223,8 +1223,8 @@ may_brotli (http_connection_t *con)
* @return 1 on success, else 0.
*/
static int
compress_response_deflate (const size_t res_len, const char *res, size_t *comp_len,
char **comp)
compress_response_deflate (const size_t res_len, const char *res,
size_t *comp_len, char **comp)
{
Bytef *cbuf;
uLongf cbuf_size;
Expand Down Expand Up @@ -1258,8 +1258,8 @@ compress_response_deflate (const size_t res_len, const char *res, size_t *comp_l
* @return 1 on success, else 0.
*/
static int
compress_response_brotli (const size_t res_len, const char *res, size_t *comp_len,
char **comp)
compress_response_brotli (const size_t res_len, const char *res,
size_t *comp_len, char **comp)
{
size_t cbuf_size;
uint8_t *cbuf;
Expand All @@ -1268,13 +1268,9 @@ compress_response_brotli (const size_t res_len, const char *res, size_t *comp_le
cbuf_size = BrotliEncoderMaxCompressedSize (res_len);
cbuf = g_malloc (cbuf_size);

ret = BrotliEncoderCompress (BROTLI_DEFAULT_QUALITY,
BROTLI_DEFAULT_WINDOW,
BROTLI_DEFAULT_MODE,
res_len,
(uint8_t*) res,
&cbuf_size,
cbuf);
ret = BrotliEncoderCompress (BROTLI_DEFAULT_QUALITY, BROTLI_DEFAULT_WINDOW,
BROTLI_DEFAULT_MODE, res_len, (uint8_t *) res,
&cbuf_size, cbuf);

if ((ret == BROTLI_TRUE) && (cbuf_size < res_len))
{
Expand Down Expand Up @@ -1640,8 +1636,7 @@ exec_gmp_get (http_connection_t *con, gsad_connection_info_t *con_info,
}
#endif

if ((encoding == NULL)
&& may_deflate (con))
if ((encoding == NULL) && may_deflate (con))
{
gsize comp_len;

Expand Down

0 comments on commit 2eb2ba1

Please sign in to comment.