Skip to content

Commit

Permalink
Refs #20439: Make ints size explicit. Leave it as 32 to cover all the…
Browse files Browse the repository at this point in the history
… range of stoi()

Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com>
  • Loading branch information
Mario-DL committed Feb 27, 2024
1 parent 26edae5 commit 05299b8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/cpp/rtps/security/SecurityManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4292,7 +4292,7 @@ void SecurityManager::AuthenticationHandshakeProperties::parse_from_property_pol

if (max_handshake_requests != nullptr)
{
max_handshake_requests_ = PropertyParser::as_int(
max_handshake_requests_ = (int32_t)PropertyParser::as_int(
*max_handshake_requests,
false, 0,
true, 1,
Expand All @@ -4304,7 +4304,7 @@ void SecurityManager::AuthenticationHandshakeProperties::parse_from_property_pol

if (initial_handshake_resend_period != nullptr)
{
initial_handshake_resend_period_ms_ = PropertyParser::as_int(
initial_handshake_resend_period_ms_ = (int32_t)PropertyParser::as_int(
*initial_handshake_resend_period,
false, 0,
true, 1,
Expand Down
16 changes: 7 additions & 9 deletions src/cpp/rtps/security/SecurityManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,10 @@ class SecurityManager

// Maximum number of handshake requests to be sent
// Must be greater than 0
int max_handshake_requests_;
int32_t max_handshake_requests_;
// Initial wait time (in milliseconds) for the first handshake request resend
// Must be greater than 0
int initial_handshake_resend_period_ms_;
int32_t initial_handshake_resend_period_ms_;
// Gain for the period between handshake request resends
// The initial period is multiplied by this value each time a resend is performed
// Must be greater than 1
Expand All @@ -390,12 +390,13 @@ class SecurityManager

AuthenticationInfo(
AuthenticationStatus auth_status)
: identity_handle_(nullptr)
: handshake_requests_sent_(0)
, identity_handle_(nullptr)
, handshake_handle_(nullptr)
, auth_status_(auth_status)
, expected_sequence_number_(0)
, change_sequence_number_(SequenceNumber_t::unknown())
, handshake_requests_sent_(0)

{
}

Expand All @@ -410,6 +411,8 @@ class SecurityManager
{
}

int32_t handshake_requests_sent_;

IdentityHandle* identity_handle_;

HandshakeHandle* handshake_handle_;
Expand All @@ -422,8 +425,6 @@ class SecurityManager

EventUniquePtr event_;

int handshake_requests_sent_;

private:

AuthenticationInfo(
Expand All @@ -434,9 +435,6 @@ class SecurityManager

typedef std::unique_ptr<AuthenticationInfo> AuthUniquePtr;

static constexpr uint32_t INITIAL_RESEND_HANDSHAKE_MILLISECS = 125;
static constexpr uint32_t MAX_HANDSHAKE_REQUESTS = 5;

DiscoveredParticipantInfo(
AuthenticationStatus auth_status,
const ParticipantProxyData& participant_data)
Expand Down

0 comments on commit 05299b8

Please sign in to comment.