File tree Expand file tree Collapse file tree 5 files changed +289
-166
lines changed Expand file tree Collapse file tree 5 files changed +289
-166
lines changed Original file line number Diff line number Diff line change @@ -4255,6 +4255,19 @@ void SecurityManager::resend_handshake_message_token(
4255
4255
remote_participant_info->event_ ->cancel_timer ();
4256
4256
remote_participant_info->auth_status_ = AUTHENTICATION_FAILED;
4257
4257
on_validation_failed (dp_it->second ->participant_data (), exception);
4258
+ if (remote_participant_info->change_sequence_number_ != SequenceNumber_t::unknown ())
4259
+ {
4260
+ participant_stateless_message_writer_history_->remove_change (
4261
+ remote_participant_info->change_sequence_number_ );
4262
+ remote_participant_info->change_sequence_number_ = SequenceNumber_t::unknown ();
4263
+ // Return the handshake handle
4264
+ if (remote_participant_info->handshake_handle_ != nullptr )
4265
+ {
4266
+ authentication_plugin_->return_handshake_handle (
4267
+ remote_participant_info->handshake_handle_ , exception);
4268
+ remote_participant_info->handshake_handle_ = nullptr ;
4269
+ }
4270
+ }
4258
4271
}
4259
4272
}
4260
4273
else
Original file line number Diff line number Diff line change @@ -854,7 +854,7 @@ class PubSubReader
854
854
}
855
855
856
856
#if HAVE_SECURITY
857
- void waitAuthorized (
857
+ void wait_authorized (
858
858
std::chrono::seconds timeout = std::chrono::seconds::zero(),
859
859
unsigned int expected = 1)
860
860
{
@@ -880,16 +880,28 @@ class PubSubReader
880
880
std::cout << " Reader authorization finished..." << std::endl;
881
881
}
882
882
883
- void waitUnauthorized ()
883
+ void wait_unauthorized (
884
+ std::chrono::seconds timeout = std::chrono::seconds::zero(),
885
+ unsigned int expected = 1)
884
886
{
885
887
std::unique_lock<std::mutex> lock (mutexAuthentication_);
886
888
887
889
std::cout << " Reader is waiting unauthorization..." << std::endl;
888
890
889
- cvAuthentication_.wait (lock, [&]() -> bool
890
- {
891
- return unauthorized_ > 0 ;
892
- });
891
+ if (timeout == std::chrono::seconds::zero ())
892
+ {
893
+ cvAuthentication_.wait (lock, [&]()
894
+ {
895
+ return unauthorized_ >= expected;
896
+ });
897
+ }
898
+ else
899
+ {
900
+ cvAuthentication_.wait_for (lock, timeout, [&]()
901
+ {
902
+ return unauthorized_ >= expected;
903
+ });
904
+ }
893
905
894
906
std::cout << " Reader unauthorization finished..." << std::endl;
895
907
}
Original file line number Diff line number Diff line change @@ -731,7 +731,7 @@ class PubSubWriter
731
731
}
732
732
733
733
#if HAVE_SECURITY
734
- void waitAuthorized (
734
+ void wait_authorized (
735
735
std::chrono::seconds timeout = std::chrono::seconds::zero(),
736
736
unsigned int expected = 1)
737
737
{
@@ -757,16 +757,28 @@ class PubSubWriter
757
757
std::cout << " Writer authorization finished..." << std::endl;
758
758
}
759
759
760
- void waitUnauthorized ()
760
+ void wait_unauthorized (
761
+ std::chrono::seconds timeout = std::chrono::seconds::zero(),
762
+ unsigned int expected = 1)
761
763
{
762
764
std::unique_lock<std::mutex> lock (mutexAuthentication_);
763
765
764
766
std::cout << " Writer is waiting unauthorization..." << std::endl;
765
767
766
- cvAuthentication_.wait (lock, [&]() -> bool
767
- {
768
- return unauthorized_ > 0 ;
769
- });
768
+ if (timeout == std::chrono::seconds::zero ())
769
+ {
770
+ cvAuthentication_.wait (lock, [&]()
771
+ {
772
+ return unauthorized_ >= expected;
773
+ });
774
+ }
775
+ else
776
+ {
777
+ cvAuthentication_.wait_for (lock, timeout, [&]()
778
+ {
779
+ return unauthorized_ >= expected;
780
+ });
781
+ }
770
782
771
783
std::cout << " Writer unauthorization finished..." << std::endl;
772
784
}
Original file line number Diff line number Diff line change @@ -272,7 +272,8 @@ class PubSubWriterReader
272
272
do
273
273
{
274
274
wreader_.receive_one (datareader, ret);
275
- } while (ret);
275
+ }
276
+ while (ret);
276
277
}
277
278
}
278
279
@@ -682,7 +683,7 @@ class PubSubWriterReader
682
683
}
683
684
684
685
#if HAVE_SECURITY
685
- void waitAuthorized (
686
+ void wait_authorized (
686
687
unsigned int how_many = 1 )
687
688
{
688
689
std::unique_lock<std::mutex> lock (mutexAuthentication_);
@@ -698,7 +699,7 @@ class PubSubWriterReader
698
699
std::cout << " WReader authorization finished..." << std::endl;
699
700
}
700
701
701
- void waitUnauthorized (
702
+ void wait_unauthorized (
702
703
unsigned int how_many = 1 )
703
704
{
704
705
std::unique_lock<std::mutex> lock (mutexAuthentication_);
You can’t perform that action at this time.
0 commit comments