From 5a34955fae09990f074a3b974663390950148d30 Mon Sep 17 00:00:00 2001 From: demin80 Date: Wed, 16 Jan 2019 10:52:14 -0500 Subject: [PATCH 1/2] added type conversion to avoid signed-vs-unsigned-comparison warning --- include/cppkafka/utils/buffered_producer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/cppkafka/utils/buffered_producer.h b/include/cppkafka/utils/buffered_producer.h index 0ee3f93d..a365d6f5 100644 --- a/include/cppkafka/utils/buffered_producer.h +++ b/include/cppkafka/utils/buffered_producer.h @@ -811,7 +811,7 @@ void BufferedProducer::do_add_message(BuilderType&& build // Flush the queues only if a regular message is added. Retry messages may be added // from rdkafka callbacks, and flush/async_flush is a user-level call - if (queue_kind == QueueKind::Regular && flush_action == FlushAction::DoFlush && (max_buffer_size_ >= 0) && (max_buffer_size_ <= get_buffer_size())) { + if (queue_kind == QueueKind::Regular && flush_action == FlushAction::DoFlush && (max_buffer_size_ >= 0) && (max_buffer_size_ <= (ssize_t)get_buffer_size())) { if (flush_method_ == FlushMethod::Sync) { flush(); } From 755e9f10c27a6d32b67d8c53b33b469190413458 Mon Sep 17 00:00:00 2001 From: demin80 Date: Fri, 18 Jan 2019 16:58:03 -0500 Subject: [PATCH 2/2] added missing return --- include/cppkafka/utils/buffered_producer.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/cppkafka/utils/buffered_producer.h b/include/cppkafka/utils/buffered_producer.h index a365d6f5..8f3a9b2c 100644 --- a/include/cppkafka/utils/buffered_producer.h +++ b/include/cppkafka/utils/buffered_producer.h @@ -708,6 +708,7 @@ bool BufferedProducer::flush(std::chrono::milliseconds ti }; re_enqueuer(retry_flush_queue, retry_messages_, retry_mutex_); re_enqueuer(flush_queue, messages_, mutex_); + return true; } else { async_flush();