`ctf` plugin: infer packet's total size from packet's content size
[babeltrace.git] / plugins / ctf / common / msg-iter / msg-iter.c
index 7077d2e7360cb4739a3129508bd06aae49dd0ac6..b7a0b9fd47b8f2003cb3dd6cb9363e76195acef2 100644 (file)
@@ -969,14 +969,8 @@ enum bt_msg_iter_status set_current_packet_content_sizes(
 
        if (notit->cur_exp_packet_total_size == -1) {
                if (notit->cur_exp_packet_content_size != -1) {
-                       BT_LOGW("Content size is set, but packet size is not: "
-                               "notit-addr=%p, packet-context-field-addr=%p, "
-                               "packet-size=%" PRId64 ", content-size=%" PRId64,
-                               notit, notit->dscopes.stream_packet_context,
-                               notit->cur_exp_packet_total_size,
-                               notit->cur_exp_packet_content_size);
-                       status = BT_MSG_ITER_STATUS_ERROR;
-                       goto end;
+                       notit->cur_exp_packet_total_size =
+                               notit->cur_exp_packet_content_size;
                }
        } else {
                if (notit->cur_exp_packet_content_size == -1) {
@@ -985,6 +979,9 @@ 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);
+
        if (notit->cur_exp_packet_content_size >
                        notit->cur_exp_packet_total_size) {
                BT_LOGW("Invalid packet or content size: "
@@ -2942,7 +2939,6 @@ end:
        ret = set_current_packet_content_sizes(notit);
        if (ret) {
                status = BT_MSG_ITER_STATUS_ERROR;
-               goto end;
        }
 
        return status;
This page took 0.025524 seconds and 4 git commands to generate.