diff options
author | mcrymble <matthew.crymble@ni.com> | 2019-06-10 17:51:30 -0500 |
---|---|---|
committer | Brent Stapleton <brent.stapleton@ettus.com> | 2019-06-14 15:32:57 -0700 |
commit | efcbd58fbb6ef39c30104d3f412202feed8ce8d8 (patch) | |
tree | 4c71b4a2805eca7942a0de77f991555cf96d49b4 /host | |
parent | b89f76bd4d7936e2a5ecf26a8ef59f1585e1bf25 (diff) | |
download | uhd-efcbd58fbb6ef39c30104d3f412202feed8ce8d8.tar.gz uhd-efcbd58fbb6ef39c30104d3f412202feed8ce8d8.tar.bz2 uhd-efcbd58fbb6ef39c30104d3f412202feed8ce8d8.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 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: |