mirror of
https://github.com/sogou/workflow.git
synced 2026-10-29 03:27:04 +08:00
fix KafkaMessage::parse_record_batch (#1680)
* fix KafkaMessage::parse_record_batch * use compress_type instead of compressed
This commit is contained in:
@@ -1450,10 +1450,11 @@ int KafkaMessage::parse_record_batch(void **buf, size_t *size,
|
||||
return 1;
|
||||
|
||||
KafkaBlock block;
|
||||
int compress_type = hdr.attributes & 7;
|
||||
|
||||
if (hdr.attributes & 7)
|
||||
if (compress_type != 0)
|
||||
{
|
||||
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;
|
||||
@@ -1492,7 +1493,7 @@ int KafkaMessage::parse_record_batch(void **buf, size_t *size,
|
||||
}
|
||||
}
|
||||
|
||||
if (hdr.attributes == 0)
|
||||
if (compress_type == 0)
|
||||
{
|
||||
*buf = p;
|
||||
*size = n;
|
||||
|
||||
Reference in New Issue
Block a user