Skip to content

Commit

Permalink
Mock push_request_errors() appended the errors in reverse order
Browse files Browse the repository at this point in the history
  • Loading branch information
edenhill committed Oct 11, 2021
1 parent 2d78e92 commit 063a9ae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/rdkafka_mock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1608,6 +1608,7 @@ rd_kafka_mock_push_request_errors_array (rd_kafka_mock_cluster_t *mcluster,
const rd_kafka_resp_err_t *errors) {
rd_kafka_mock_error_stack_t *errstack;
size_t totcnt;
size_t i;

mtx_lock(&mcluster->lock);

Expand All @@ -1622,8 +1623,8 @@ rd_kafka_mock_push_request_errors_array (rd_kafka_mock_cluster_t *mcluster,
sizeof(*errstack->errs));
}

while (cnt > 0) {
errstack->errs[errstack->cnt].err = errors[--cnt];
for (i = 0 ; i < cnt ; i++) {
errstack->errs[errstack->cnt].err = errors[i];
errstack->errs[errstack->cnt++].rtt = 0;
}

Expand Down

0 comments on commit 063a9ae

Please sign in to comment.