Skip to content

Commit

Permalink
use compress_type instead of compressed
Browse files Browse the repository at this point in the history
  • Loading branch information
kedixa committed Jan 8, 2025
1 parent 262290e commit 71870c9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/protocol/KafkaMessage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1450,11 +1450,11 @@ int KafkaMessage::parse_record_batch(void **buf, size_t *size,
return 1;

KafkaBlock block;
bool compressed = ((hdr.attributes & 7) != 0);
int compress_type = hdr.attributes & 7;

if (compressed)
if (compress_type)
{
if (uncompress_buf(*buf, hdr.length - 61 + 12, &block, hdr.attributes & 7) < 0)
if (uncompress_buf(*buf, hdr.length - 61 + 12, &block, compress_type) < 0)
return -1;

*buf = (char *)*buf + hdr.length - 61 + 12;
Expand Down Expand Up @@ -1493,7 +1493,7 @@ int KafkaMessage::parse_record_batch(void **buf, size_t *size,
}
}

if (!compressed)
if (compress_type != 0)
{
*buf = p;
*size = n;
Expand Down

0 comments on commit 71870c9

Please sign in to comment.