diff --git a/src/client/WFKafkaClient.cc b/src/client/WFKafkaClient.cc index c44e877ef6..35d37a9ffc 100644 --- a/src/client/WFKafkaClient.cc +++ b/src/client/WFKafkaClient.cc @@ -28,8 +28,9 @@ #include #include #include "WFTaskError.h" -#include "WFKafkaClient.h" #include "StringUtil.h" +#include "KafkaTaskImpl.inl" +#include "WFKafkaClient.h" #define KAFKA_HEARTBEAT_INTERVAL (3 * 1000 * 1000) diff --git a/src/client/WFKafkaClient.h b/src/client/WFKafkaClient.h index 93d27e49e7..460a95a9ef 100644 --- a/src/client/WFKafkaClient.h +++ b/src/client/WFKafkaClient.h @@ -23,10 +23,9 @@ #include #include #include +#include "WFTask.h" #include "KafkaMessage.h" #include "KafkaResult.h" -#include "KafkaTaskImpl.inl" - class WFKafkaTask; class WFKafkaClient; diff --git a/src/protocol/KafkaDataTypes.cc b/src/protocol/KafkaDataTypes.cc index f0e25b7ab3..45c38d1ffb 100644 --- a/src/protocol/KafkaDataTypes.cc +++ b/src/protocol/KafkaDataTypes.cc @@ -26,6 +26,31 @@ namespace protocol #define MIN(x, y) ((x) <= (y) ? (x) : (y)) +std::string KafkaConfig::get_sasl_info() const +{ + std::string info; + if (strcasecmp(this->ptr->mechanisms, "plain") == 0) + { + info += this->ptr->mechanisms; + info += "|"; + info += this->ptr->username; + info += "|"; + info += this->ptr->password; + info += "|"; + } + else if (strncasecmp(this->ptr->mechanisms, "SCRAM", 5) == 0) + { + info += this->ptr->mechanisms; + info += "|"; + info += this->ptr->username; + info += "|"; + info += this->ptr->password; + info += "|"; + } + + return info; +} + static int compare_member(const void *p1, const void *p2) { kafka_member_t *member1 = (kafka_member_t *)p1; diff --git a/src/protocol/KafkaDataTypes.h b/src/protocol/KafkaDataTypes.h index 0077517548..0d30e0f157 100644 --- a/src/protocol/KafkaDataTypes.h +++ b/src/protocol/KafkaDataTypes.h @@ -551,30 +551,7 @@ class KafkaConfig return kafka_sasl_set_password(password, this->ptr) == 0; } - std::string get_sasl_info() const - { - std::string info; - if (strcasecmp(this->ptr->mechanisms, "plain") == 0) - { - info += this->ptr->mechanisms; - info += "|"; - info += this->ptr->username; - info += "|"; - info += this->ptr->password; - info += "|"; - } - else if (strncasecmp(this->ptr->mechanisms, "SCRAM", 5) == 0) - { - info += this->ptr->mechanisms; - info += "|"; - info += this->ptr->username; - info += "|"; - info += this->ptr->password; - info += "|"; - } - - return info; - } + std::string get_sasl_info() const; bool new_client(kafka_sasl_t *sasl) { diff --git a/src/protocol/kafka_parser.c b/src/protocol/kafka_parser.c index 50f7c852a2..7028b517eb 100644 --- a/src/protocol/kafka_parser.c +++ b/src/protocol/kafka_parser.c @@ -613,13 +613,13 @@ int kafka_parser_append_message(const void *buf, size_t *size, if (s > parser->message_size - parser->cur_size) { - memcpy(parser->msgbuf + parser->cur_size, buf, + memcpy((char *)parser->msgbuf + parser->cur_size, buf, parser->message_size - parser->cur_size); parser->cur_size = parser->message_size; } else { - memcpy(parser->msgbuf + parser->cur_size, buf, s); + memcpy((char *)parser->msgbuf + parser->cur_size, buf, s); parser->cur_size += s; }