Skip to content

Commit

Permalink
Refs #20352: Fix windows build
Browse files Browse the repository at this point in the history
Signed-off-by: cferreiragonz <[email protected]>
  • Loading branch information
cferreiragonz committed Mar 12, 2024
1 parent b929fdf commit 261c9a0
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
9 changes: 4 additions & 5 deletions include/fastdds/rtps/network/NetworkBuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
#ifndef _FASTDDS_RTPS_NETWORK_NETWORKBUFFER_HPP
#define _FASTDDS_RTPS_NETWORK_NETWORKBUFFER_HPP

#include <cstdint> // uint32_t
#include <cstdlib> // size_t
#include <cstdint>
#include <asio.hpp>

namespace eprosima {
Expand All @@ -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)
{
Expand All @@ -54,7 +53,7 @@ struct NetworkBuffer final

NetworkBuffer(
const fastrtps::rtps::octet* ptr,
size_t s)
uint32_t s)
: buffer(ptr)
, size(s)
{
Expand Down
9 changes: 6 additions & 3 deletions src/cpp/rtps/messages/RTPSMessageGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ bool RTPSMessageGroup::append_submessage()
// - If header_msg_ is not reseted, put submessage_msg_ into a new buffer and add it to buffers_to_send_
// Final msg Struct: | header_msg_ + submessage_msg_ | payload | padding | submessage_msg_ | payload | padding | ...
//

if (participant_->security_attributes().is_rtps_protected)
#if HAVE_SECURITY
if (protect_rtps = participant_->security_attributes().is_rtps_protected)
{
// If the RTPS message is protected, the whole message will be encrypted at once
// so we need to keep the whole message in a single buffer
Expand All @@ -118,8 +118,11 @@ bool RTPSMessageGroup::append_submessage()
EPROSIMA_LOG_ERROR(RTPS_WRITER, "Cannot add RTPS submesage to the CDRMessage. Buffer too small");
return false;
}
return true;
}
else if (header_msg_->pos == RTPSMESSAGE_HEADER_SIZE && header_msg_->length == RTPSMESSAGE_HEADER_SIZE)
#endif // if HAVE_SECURITY

if (header_msg_->pos == RTPSMESSAGE_HEADER_SIZE && header_msg_->length == RTPSMESSAGE_HEADER_SIZE)
{
// header_msg_ is reseted. This is the first submessage
if (!append_message(participant_, header_msg_, submessage_msg_))
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/rtps/transport/TCPChannelResource.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/cpp/rtps/transport/test_UDPv4Transport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ bool test_UDPv4Transport::log_drop(
const std::list<NetworkBuffer>& buffers,
uint32_t size)
{
static_cast<void>(size);
if (test_UDPv4Transport_DropLog.size() < test_UDPv4Transport_DropLogLength)
{
vector<octet> message;
Expand Down

0 comments on commit 261c9a0

Please sign in to comment.