Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,30 @@ bool RepeaterDataFilter::evaluate(

auto write_data = std::static_pointer_cast<RepeaterWriteData>(sample_info.user_write_data);

if (!write_data)
{
// The origin information is carried through WriteParams::user_write_data, which is only attached to
// ALIVE samples (see dds::CommonWriter::fill_to_send_data_)
// Dispose and unregister samples are sent through DataWriter::dispose / DataWriter::unregister_instance,
// whose public API does not allow attaching WriteParams, so user_write_data is null for them.
// In that case the origin participant is unknown and the sample cannot be filtered out by origin:
// let it through (it already passed the SelfDataFilter check above,
// so it is not sent back to the writer's own participant)
logDebug(
REPEATER_DATA_FILTER,
"Sample without origin information (e.g. dispose/unregister); "
"considering it relevant for reader GUID " << reader_guid << ".");
return true;
}

bool is_relevant = write_data->last_writer_guid_prefix != reader_guid.guidPrefix;

logDebug(
REPEATER_DATA_FILTER,
"Evaluating whether sample with origin writer GUID prefix " << write_data->last_writer_guid_prefix <<
" is relevant for reader GUID " << reader_guid << "? " << (is_relevant ? "TRUE" : "FALSE"));
"Evaluating whether sample with origin writer GUID prefix "
<< write_data->last_writer_guid_prefix
<< " is relevant for reader GUID " << reader_guid
<< "? " << (is_relevant ? "TRUE" : "FALSE"));

return is_relevant;
}
Expand Down
Loading