@@ -203,6 +203,7 @@ TransportClient::associate(const AssociationData& data, bool active)
203
203
ACE_GUARD_RETURN (ACE_Thread_Mutex, guard, lock_, false );
204
204
205
205
repo_id_ = repo_id;
206
+ OPENDDS_ASSERT (repo_id_ != GUID_UNKNOWN);
206
207
207
208
if (impls_.empty ()) {
208
209
if (DCPS_debug_level) {
@@ -248,6 +249,7 @@ TransportClient::associate(const AssociationData& data, bool active)
248
249
pa->impls_ .clear ();
249
250
pa->blob_index_ = 0 ;
250
251
pa->data_ = data;
252
+ OPENDDS_ASSERT (repo_id_ != GUID_UNKNOWN);
251
253
pa->attribs_ .local_id_ = repo_id_;
252
254
pa->attribs_ .priority_ = get_priority_value (data);
253
255
pa->attribs_ .local_reliable_ = reliable_;
@@ -621,9 +623,9 @@ TransportClient::add_link(const DataLink_rch& link, const GUID_t& peer)
621
623
622
624
TransportReceiveListener_rch trl = get_receive_listener ();
623
625
626
+ OPENDDS_ASSERT (repo_id_ != GUID_UNKNOWN);
624
627
if (trl) {
625
628
link->make_reservation (peer, repo_id_, trl, reliable_);
626
-
627
629
} else {
628
630
link->make_reservation (peer, repo_id_, get_send_listener (), reliable_);
629
631
}
@@ -745,6 +747,7 @@ TransportClient::disassociate(const GUID_t& peerId)
745
747
link.in ()));
746
748
}
747
749
750
+ OPENDDS_ASSERT (repo_id_ != GUID_UNKNOWN);
748
751
link->release_reservations (peerId, repo_id_, released);
749
752
750
753
if (!released.empty ()) {
@@ -777,6 +780,11 @@ void TransportClient::transport_stop()
777
780
const GUID_t repo_id = repo_id_;
778
781
guard.release ();
779
782
783
+ if (repo_id == GUID_UNKNOWN) {
784
+ // Not associated so nothing to stop.
785
+ return ;
786
+ }
787
+
780
788
for (size_t i = 0 ; i < impls.size (); ++i) {
781
789
const TransportImpl_rch impl = impls[i].lock ();
782
790
if (impl) {
@@ -1112,6 +1120,9 @@ SendControlStatus
1112
1120
TransportClient::send_control (const DataSampleHeader& header,
1113
1121
Message_Block_Ptr msg)
1114
1122
{
1123
+ if (repo_id_ == GUID_UNKNOWN) {
1124
+ return SEND_CONTROL_OK;
1125
+ }
1115
1126
return links_.send_control (repo_id_, get_send_listener (), header, move (msg));
1116
1127
}
1117
1128
@@ -1120,6 +1131,10 @@ TransportClient::send_control_to(const DataSampleHeader& header,
1120
1131
Message_Block_Ptr msg,
1121
1132
const GUID_t& destination)
1122
1133
{
1134
+ if (repo_id_ == GUID_UNKNOWN) {
1135
+ return SEND_CONTROL_OK;
1136
+ }
1137
+
1123
1138
DataLinkSet singular;
1124
1139
{
1125
1140
ACE_GUARD_RETURN (ACE_Thread_Mutex, guard, lock_, SEND_CONTROL_ERROR);
@@ -1143,6 +1158,9 @@ TransportClient::remove_sample(const DataSampleElement* sample)
1143
1158
bool
1144
1159
TransportClient::remove_all_msgs ()
1145
1160
{
1161
+ if (repo_id_ == GUID_UNKNOWN) {
1162
+ return true ;
1163
+ }
1146
1164
return links_.remove_all_msgs (repo_id_);
1147
1165
}
1148
1166
0 commit comments