Skip to content

Commit

Permalink
Refs #20658. Fix issue.
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
  • Loading branch information
MiguelCompany committed Apr 9, 2024
1 parent bbbd261 commit b960714
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
15 changes: 14 additions & 1 deletion src/cpp/rtps/security/SecurityManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1263,7 +1263,7 @@ bool SecurityManager::create_participant_volatile_message_secure_writer()
RTPSWriter* wout = nullptr;
if (participant_->createWriter(&wout, watt, participant_volatile_message_secure_pool_,
participant_volatile_message_secure_writer_history_,
nullptr, participant_volatile_message_secure_writer_entity_id, true))
this, participant_volatile_message_secure_writer_entity_id, true))
{
participant_->set_endpoint_rtps_protection_supports(wout, false);
participant_volatile_message_secure_writer_ = dynamic_cast<StatefulWriter*>(wout);
Expand Down Expand Up @@ -4341,3 +4341,16 @@ bool SecurityManager::DiscoveredParticipantInfo::check_guid_comes_from(
}
return ret;
}

void SecurityManager::onWriterChangeReceivedByAll(
RTPSWriter* writer,
CacheChange_t* change)
{
static_cast<void>(writer);
assert(writer == participant_volatile_message_secure_writer_);

if (nullptr != participant_volatile_message_secure_writer_history_)
{
participant_volatile_message_secure_writer_history_->remove_change(change);
}
}
8 changes: 7 additions & 1 deletion src/cpp/rtps/security/SecurityManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <fastdds/rtps/resources/TimedEvent.h>
#include <fastdds/rtps/security/authentication/Handshake.h>
#include <fastdds/rtps/security/common/ParticipantGenericMessage.h>
#include <fastdds/rtps/writer/WriterListener.h>
#include <fastrtps/utils/ProxyPool.hpp>
#include <fastrtps/utils/shared_mutex.hpp>

Expand All @@ -45,6 +46,7 @@ namespace fastrtps {
namespace rtps {

class RTPSParticipantImpl;
class RTPSWriter;
class StatelessWriter;
class StatelessReader;
class StatefulWriter;
Expand All @@ -66,7 +68,7 @@ struct EndpointSecurityAttributes;
*
* @ingroup SECURITY_MODULE
*/
class SecurityManager
class SecurityManager : private WriterListener
{
public:

Expand Down Expand Up @@ -874,6 +876,10 @@ class SecurityManager
}
}

void onWriterChangeReceivedByAll(
RTPSWriter* writer,
CacheChange_t* change) override;

/**
* Syncronization object for plugin initialization, <tt>mutex_</tt> protection is not necessary to guarantee plugin
* availability.
Expand Down

0 comments on commit b960714

Please sign in to comment.