Skip to content

Commit

Permalink
Correctly give priority to intraprocess over data sharing (#2202)
Browse files Browse the repository at this point in the history
(cherry picked from commit 3c7be7e)

Co-authored-by: Miguel Company <miguelcompany@eprosima.com>
  • Loading branch information
mergify[bot] and MiguelCompany authored Sep 14, 2021
1 parent 98cb08c commit b820c35
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/cpp/rtps/reader/StatefulReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ bool StatefulReader::matched_writer_add(
return false;
}

bool is_datasharing = is_datasharing_compatible_with(wdata);
bool is_same_process = RTPSDomainImpl::should_intraprocess_between(m_guid, wdata.guid());
bool is_datasharing = !is_same_process && is_datasharing_compatible_with(wdata);

for (WriterProxy* it : matched_writers_)
{
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/rtps/reader/StatelessReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ bool StatelessReader::matched_writer_add(
}
}

bool is_datasharing = is_datasharing_compatible_with(wdata);
bool is_same_process = RTPSDomainImpl::should_intraprocess_between(m_guid, wdata.guid());
bool is_datasharing = !is_same_process && is_datasharing_compatible_with(wdata);

RemoteWriterInfo_t info;
info.guid = wdata.guid();
Expand Down
1 change: 1 addition & 0 deletions src/cpp/rtps/writer/ReaderLocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ bool ReaderLocator::start(
locator_info_.remote_guid = remote_guid;

is_local_reader_ = RTPSDomainImpl::should_intraprocess_between(owner_->getGuid(), remote_guid);
is_datasharing &= !is_local_reader_;
local_reader_ = nullptr;

if (!is_local_reader_ && !is_datasharing)
Expand Down

0 comments on commit b820c35

Please sign in to comment.