diff options
author | mcrymble <matthew.crymble@ni.com> | 2019-06-10 17:51:30 -0500 |
---|---|---|
committer | michael-west <michael.west@ettus.com> | 2019-06-12 13:18:54 -0700 |
commit | 2aa5289d0cfe127058cdd8ee67915c9020179955 (patch) | |
tree | b794acaeeaf5c541f5f4e89b7f62cefc958ef994 /host | |
parent | 1711ff33f4a1a646c427bf5b798f100c52eba730 (diff) | |
download | uhd-2aa5289d0cfe127058cdd8ee67915c9020179955.tar.gz uhd-2aa5289d0cfe127058cdd8ee67915c9020179955.tar.bz2 uhd-2aa5289d0cfe127058cdd8ee67915c9020179955.zip |
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.
Diffstat (limited to 'host')
-rw-r--r-- | host/lib/transport/super_recv_packet_handler.hpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/host/lib/transport/super_recv_packet_handler.hpp b/host/lib/transport/super_recv_packet_handler.hpp index 342d273a6..eec784a07 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: |