Fix: flt.utils.muxer: reset is_ended variable after each iteration
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 7 Mar 2019 19:35:15 +0000 (14:35 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 22:19:38 +0000 (18:19 -0400)
Problem
-------
Whenever an upstream message iterator returns STATUS_END, we remove it
from the array used to order the messages. The variable `is_ended` is
used to record if a upstream message iterator is ended and must be
removed. This variable is only set to false _before_ the loop. If the
first upstream message iterator in the array needs to be removed, all
the following iterators will be mistakenly removed.

Solution
--------
The `is_ended` variable must be reset to false at each iteration so that
only the upstream message iterator that is actually ended is removed from
the array.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
plugins/utils/muxer/muxer.c

index 9fb1ae20d80f05aff0c9495e473e436b24ef2948..63a0f601210ef7abdd7ed26031fdaf9610f1a7a9 100644 (file)
@@ -910,13 +910,13 @@ bt_self_message_iterator_status validate_muxer_upstream_msg_iters(
        bt_self_message_iterator_status status =
                BT_SELF_MESSAGE_ITERATOR_STATUS_OK;
        size_t i;
-       bool is_ended = false;
 
        BT_LOGV("Validating muxer's upstream message iterator wrappers: "
                "muxer-msg-iter-addr=%p", muxer_msg_iter);
 
        for (i = 0; i < muxer_msg_iter->active_muxer_upstream_msg_iters->len;
                        i++) {
+               bool is_ended = false;
                struct muxer_upstream_msg_iter *muxer_upstream_msg_iter =
                        g_ptr_array_index(
                                muxer_msg_iter->active_muxer_upstream_msg_iters,
This page took 0.026204 seconds and 4 git commands to generate.