Skip to content

Commit

Permalink
Refs #21293: Temptative fix
Browse files Browse the repository at this point in the history
Signed-off-by: Mario Dominguez <[email protected]>
  • Loading branch information
Mario-DL committed Jul 9, 2024
1 parent 4a5cfec commit 18b7f62
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/cpp/rtps/writer/ReaderLocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,9 @@ bool ReaderLocator::send(
return true;
}

BaseReader* ReaderLocator::local_reader()
BaseReader* ReaderLocator::local_reader(bool force_update)
{
if (!local_reader_)
if (!local_reader_ || force_update)
{
local_reader_ = RTPSDomainImpl::find_local_reader(general_locator_info_.remote_guid);
}
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/rtps/writer/ReaderLocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class ReaderLocator : public RTPSMessageSenderInterface
return is_local_reader_;
}

BaseReader* local_reader();
BaseReader* local_reader(bool force_upload = false);

void local_reader(
BaseReader* local_reader)
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/rtps/writer/ReaderProxy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,9 @@ class ReaderProxy
* Get the local reader on the same process (if any).
* @return The local reader on the same process.
*/
inline BaseReader* local_reader()
inline BaseReader* local_reader(bool force_update = false)
{
return locator_info_.local_reader();
return locator_info_.local_reader(force_update);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/rtps/writer/StatefulWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ bool StatefulWriter::intraprocess_delivery(
CacheChange_t* change,
ReaderProxy* reader_proxy)
{
BaseReader* reader = reader_proxy->local_reader();
BaseReader* reader = reader_proxy->local_reader(true);
if (reader)
{
if (change->write_params.related_sample_identity() != SampleIdentity::unknown())
Expand Down
2 changes: 1 addition & 1 deletion test/mock/rtps/ReaderLocator/rtps/writer/ReaderLocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ class ReaderLocator : public RTPSMessageSenderInterface
return false;
}

BaseReader* local_reader()
BaseReader* local_reader(bool /*force_update*/)
{
return nullptr;
}
Expand Down

0 comments on commit 18b7f62

Please sign in to comment.