Skip to content

Commit

Permalink
Merge pull request #157 from demin80/buffer-size-comparison-fix2
Browse files Browse the repository at this point in the history
added type conversion to avoid signed-vs-unsigned-comparison warning
  • Loading branch information
mfontanini authored Jan 19, 2019
2 parents fb4c5ed + 755e9f1 commit efa4e95
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/cppkafka/utils/buffered_producer.h
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,7 @@ bool BufferedProducer<BufferType, Allocator>::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();
Expand Down Expand Up @@ -811,7 +812,7 @@ void BufferedProducer<BufferType, Allocator>::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();
}
Expand Down

0 comments on commit efa4e95

Please sign in to comment.