Skip to content

Commit

Permalink
[modify] change lz4 compress to default
Browse files Browse the repository at this point in the history
  • Loading branch information
shabicheng committed Dec 25, 2019
1 parent 0601584 commit aa8a26d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/log_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ aos_status_t *log_post_logs_from_proto_buf_with_option(const char *endpoint, con
apr_table_set(headers, LOG_BODY_RAW_SIZE, apr_itoa(options->pool, org_body_size));
int compress_bound = LZ4_compressBound(org_body_size);
char *compress_data = aos_pcalloc(options->pool, compress_bound);
int compressed_size = LZ4_compress(body, compress_data, org_body_size);
int compressed_size = LZ4_compress_default(body, compress_data, org_body_size, compress_bound);

if(compressed_size <= 0)
{
s = aos_status_create(options->pool);
Expand Down Expand Up @@ -179,7 +180,7 @@ aos_status_t *log_post_logs_with_sts_token_with_option(aos_pool_t *p, const char
apr_table_set(headers, LOG_BODY_RAW_SIZE, apr_itoa(options->pool, org_body_size));
int compress_bound = LZ4_compressBound(org_body_size);
char *compress_data = aos_pcalloc(options->pool, compress_bound);
int compressed_size = LZ4_compress(body, compress_data, org_body_size);
int compressed_size = LZ4_compress_default(body, compress_data, org_body_size, compress_bound);
if(compressed_size <= 0)
{
s = aos_status_create(options->pool);
Expand Down
2 changes: 1 addition & 1 deletion src/log_http_cont.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ log_buf* _compressed_buffer(apr_pool_t* pool,log_buf* before)
char *body = before->data;
int compress_bound = LZ4_compressBound((int)before->length);
char *compress_data = aos_pcalloc(pool, compress_bound);
int compressed_size = LZ4_compress(body, compress_data, (int)before->length);
int compressed_size = LZ4_compress_default(body, compress_data, (int)before->length, compress_bound);

log_buf* after = aos_pcalloc(pool, sizeof(log_buf));

Expand Down

0 comments on commit aa8a26d

Please sign in to comment.