diff --git a/include/fastdds/rtps/network/NetworkBuffer.hpp b/include/fastdds/rtps/network/NetworkBuffer.hpp index f9f49db3e65..6048ec75aab 100644 --- a/include/fastdds/rtps/network/NetworkBuffer.hpp +++ b/include/fastdds/rtps/network/NetworkBuffer.hpp @@ -19,8 +19,7 @@ #ifndef _FASTDDS_RTPS_NETWORK_NETWORKBUFFER_HPP #define _FASTDDS_RTPS_NETWORK_NETWORKBUFFER_HPP -#include // uint32_t -#include // size_t +#include #include namespace eprosima { @@ -36,11 +35,11 @@ struct NetworkBuffer final //! Pointer to the buffer where the data is stored. const void* buffer; //! Number of bytes to use starting at @c buffer. - size_t size; + uint32_t size; NetworkBuffer( const void* ptr, - size_t s) + uint32_t s) : buffer(ptr) , size(s) { @@ -54,7 +53,7 @@ struct NetworkBuffer final NetworkBuffer( const fastrtps::rtps::octet* ptr, - size_t s) + uint32_t s) : buffer(ptr) , size(s) { diff --git a/src/cpp/rtps/transport/TCPChannelResource.h b/src/cpp/rtps/transport/TCPChannelResource.h index 673fd4956e3..8473472fcea 100644 --- a/src/cpp/rtps/transport/TCPChannelResource.h +++ b/src/cpp/rtps/transport/TCPChannelResource.h @@ -152,7 +152,7 @@ class TCPChannelResource : public ChannelResource const fastrtps::rtps::octet* header, size_t header_size, const fastrtps::rtps::octet* data, - size_t data_size, + uint32_t data_size, asio::error_code& ec) { NetworkBuffer buffers(data, data_size); diff --git a/src/cpp/rtps/transport/test_UDPv4Transport.cpp b/src/cpp/rtps/transport/test_UDPv4Transport.cpp index 6df9b8aac86..ddd3de53fdb 100644 --- a/src/cpp/rtps/transport/test_UDPv4Transport.cpp +++ b/src/cpp/rtps/transport/test_UDPv4Transport.cpp @@ -494,6 +494,7 @@ bool test_UDPv4Transport::log_drop( const std::list& buffers, uint32_t size) { + uint32_t total_size = size; if (test_UDPv4Transport_DropLog.size() < test_UDPv4Transport_DropLogLength) { vector message; @@ -502,7 +503,7 @@ bool test_UDPv4Transport::log_drop( auto byte_data = static_cast(buf.buffer); message.insert(message.end(), byte_data, byte_data + buf.size); } - assert(message.size() == size); + assert(message.size() == total_size); test_UDPv4Transport_DropLog.push_back(message); return true; }