Fix: msg-iter.c: accept no packet total and content sizes
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sun, 7 Apr 2019 02:16:36 +0000 (22:16 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 22:19:39 +0000 (18:19 -0400)
This changes an assertion in set_current_packet_content_sizes() to check
that either both the packet and content sizes are set (one can be set
from the other) or both are unset.

It's okay that both total and content sizes are unset: the data decoder
is already implemented to end the packet when the medium returns
`BT_MSG_ITER_MEDIUM_STATUS_EOF`.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
plugins/ctf/common/msg-iter/msg-iter.c

index b7a0b9fd47b8f2003cb3dd6cb9363e76195acef2..0d41638e988cfa88a02a6eee3434932214567e78 100644 (file)
@@ -979,8 +979,10 @@ enum bt_msg_iter_status set_current_packet_content_sizes(
                }
        }
 
-       BT_ASSERT(notit->cur_exp_packet_total_size != -1);
-       BT_ASSERT(notit->cur_exp_packet_content_size != -1);
+       BT_ASSERT((notit->cur_exp_packet_total_size >= 0 &&
+               notit->cur_exp_packet_content_size >= 0) ||
+               (notit->cur_exp_packet_total_size < 0 &&
+               notit->cur_exp_packet_content_size < 0));
 
        if (notit->cur_exp_packet_content_size >
                        notit->cur_exp_packet_total_size) {
This page took 0.02514 seconds and 4 git commands to generate.