From efcbd58fbb6ef39c30104d3f412202feed8ce8d8 Mon Sep 17 00:00:00 2001 From: mcrymble Date: Mon, 10 Jun 2019 17:51:30 -0500 Subject: transport: fixed a pre-mature buffer reset In the PACKET_INLINE_MESSAGE case, we need to extract the error code from the packet buffer. But the buffer was being released before that happens, resulting in garbage values for metadata.error_code. --- host/lib/transport/super_recv_packet_handler.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'host') diff --git a/host/lib/transport/super_recv_packet_handler.hpp b/host/lib/transport/super_recv_packet_handler.hpp index 579b1de8d..85d00bad1 100644 --- a/host/lib/transport/super_recv_packet_handler.hpp +++ b/host/lib/transport/super_recv_packet_handler.hpp @@ -642,8 +642,6 @@ private: break; case PACKET_INLINE_MESSAGE: - curr_info[index].buff.reset(); // No data, so release the buffer - curr_info[index].copy_buff = nullptr; std::swap(curr_info, next_info); // save progress from curr -> next curr_info.metadata.has_time_spec = next_info[index].ifpi.has_tsf; curr_info.metadata.time_spec = @@ -667,6 +665,9 @@ private: curr_info.metadata = metadata; UHD_LOG_FASTPATH("O"); } + next_info[index].buff.reset(); // No data, so release the buffer + next_info[index].copy_buff = nullptr; + return; case PACKET_TIMEOUT_ERROR: -- cgit v1.2.3