@@ -1065,11 +1065,13 @@ void SecurityManager::delete_participant_stateless_message_entities()
1065
1065
void SecurityManager::create_participant_stateless_message_pool ()
1066
1066
{
1067
1067
participant_stateless_message_writer_hattr_ =
1068
- { PREALLOCATED_WITH_REALLOC_MEMORY_MODE, participant_->getMaxMessageSize (), 20 , 100 };
1068
+ { PREALLOCATED_WITH_REALLOC_MEMORY_MODE, static_cast <uint32_t >(PARTICIPANT_STATELESS_MESSAGE_PAYLOAD_DEFAULT_SIZE),
1069
+ 20 , 100 };
1069
1070
participant_stateless_message_reader_hattr_ =
1070
- { PREALLOCATED_WITH_REALLOC_MEMORY_MODE, participant_->getMaxMessageSize (), 10 , 5000 };
1071
+ { PREALLOCATED_WITH_REALLOC_MEMORY_MODE, static_cast <uint32_t >(PARTICIPANT_STATELESS_MESSAGE_PAYLOAD_DEFAULT_SIZE),
1072
+ 10 , 5000 };
1071
1073
1072
- BasicPoolConfig cfg{ PREALLOCATED_WITH_REALLOC_MEMORY_MODE, participant_-> getMaxMessageSize () };
1074
+ BasicPoolConfig cfg{ PREALLOCATED_WITH_REALLOC_MEMORY_MODE, PARTICIPANT_STATELESS_MESSAGE_PAYLOAD_DEFAULT_SIZE };
1073
1075
participant_stateless_message_pool_ = TopicPayloadPoolRegistry::get (" DCPSParticipantStatelessMessage" , cfg);
1074
1076
1075
1077
PoolConfig writer_cfg = PoolConfig::from_history_attributes (participant_stateless_message_writer_hattr_);
@@ -1221,7 +1223,8 @@ void SecurityManager::delete_participant_volatile_message_secure_entities()
1221
1223
void SecurityManager::create_participant_volatile_message_secure_pool ()
1222
1224
{
1223
1225
participant_volatile_message_secure_hattr_ =
1224
- { PREALLOCATED_WITH_REALLOC_MEMORY_MODE, participant_->getMaxMessageSize (), 10 , 0 };
1226
+ { PREALLOCATED_WITH_REALLOC_MEMORY_MODE, static_cast <uint32_t >(PARTICIPANT_VOLATILE_MESSAGE_PAYLOAD_DEFAULT_SIZE),
1227
+ 10 , 0 };
1225
1228
1226
1229
PoolConfig pool_cfg = PoolConfig::from_history_attributes (participant_volatile_message_secure_hattr_);
1227
1230
participant_volatile_message_secure_pool_ =
@@ -1720,6 +1723,7 @@ void SecurityManager::process_participant_volatile_message_secure(
1720
1723
const GUID_t remote_participant_key (message.message_identity ().source_guid ().guidPrefix ,
1721
1724
c_EntityId_RTPSParticipant);
1722
1725
std::shared_ptr<ParticipantCryptoHandle> remote_participant_crypto;
1726
+ DiscoveredParticipantInfo::AuthUniquePtr remote_participant_info;
1723
1727
1724
1728
// Search remote participant crypto handle.
1725
1729
{
@@ -1735,6 +1739,7 @@ void SecurityManager::process_participant_volatile_message_secure(
1735
1739
}
1736
1740
1737
1741
remote_participant_crypto = dp_it->second ->get_participant_crypto ();
1742
+ remote_participant_info = dp_it->second ->get_auth ();
1738
1743
}
1739
1744
else
1740
1745
{
@@ -1756,12 +1761,30 @@ void SecurityManager::process_participant_volatile_message_secure(
1756
1761
EPROSIMA_LOG_ERROR (SECURITY, " Cannot set remote participant crypto tokens ("
1757
1762
<< remote_participant_key << " ) - (" << exception .what () << " )" );
1758
1763
}
1764
+ else
1765
+ {
1766
+ // Release the change from the participant_stateless_message_writer_pool_
1767
+ // As both participants have already authorized each other
1768
+
1769
+ if (remote_participant_info &&
1770
+ remote_participant_info->change_sequence_number_ != SequenceNumber_t::unknown ())
1771
+ {
1772
+ participant_stateless_message_writer_history_->remove_change (
1773
+ remote_participant_info->change_sequence_number_ );
1774
+ remote_participant_info->change_sequence_number_ = SequenceNumber_t::unknown ();
1775
+ }
1776
+ }
1759
1777
}
1760
1778
else
1761
1779
{
1762
1780
std::lock_guard<shared_mutex> _ (mutex_);
1763
1781
remote_participant_pending_messages_.emplace (remote_participant_key, std::move (message.message_data ()));
1764
1782
}
1783
+
1784
+ if (remote_participant_info)
1785
+ {
1786
+ restore_discovered_participant_info (remote_participant_key, remote_participant_info);
1787
+ }
1765
1788
}
1766
1789
else if (message.message_class_id ().compare (GMCLASSID_SECURITY_READER_CRYPTO_TOKENS) == 0 )
1767
1790
{
@@ -1917,7 +1940,7 @@ void SecurityManager::process_participant_volatile_message_secure(
1917
1940
}
1918
1941
else
1919
1942
{
1920
- EPROSIMA_LOG_INFO (SECURITY, " Discarted ParticipantGenericMessage with class id " << message.message_class_id ());
1943
+ EPROSIMA_LOG_INFO (SECURITY, " Discarded ParticipantGenericMessage with class id " << message.message_class_id ());
1921
1944
}
1922
1945
}
1923
1946
0 commit comments