Check proxy ownership before destroying competing links during saved-link restoration
This commit is contained in:
parent
07a151ebdf
commit
f78970f9e4
1 changed files with 20 additions and 4 deletions
|
|
@ -1110,13 +1110,29 @@ void Client::Impl::ProcessSavedLinks() {
|
|||
for (const auto& link_entry : links) {
|
||||
auto it = saved_port_map.find(link_entry.second.output_port.value);
|
||||
if (it == saved_port_map.end()) continue;
|
||||
uint32_t link_id = link_entry.first;
|
||||
uint32_t in_port = link_entry.second.input_port.value;
|
||||
bool is_saved = false;
|
||||
bool is_ours = false;
|
||||
for (uint32_t saved_in : it->second) {
|
||||
if (saved_in == in_port) { is_saved = true; break; }
|
||||
if (saved_in == in_port) { is_ours = true; break; }
|
||||
}
|
||||
if (!is_saved) {
|
||||
competing_link_ids.push_back(link_entry.first);
|
||||
if (!is_ours) {
|
||||
if (link_proxies.count(link_id)) {
|
||||
is_ours = true;
|
||||
}
|
||||
}
|
||||
if (!is_ours) {
|
||||
for (const auto& proxy : auto_link_proxies) {
|
||||
if (proxy && proxy->id == link_id) { is_ours = true; break; }
|
||||
}
|
||||
}
|
||||
if (!is_ours) {
|
||||
for (const auto& proxy : saved_link_proxies) {
|
||||
if (proxy && proxy->id == link_id) { is_ours = true; break; }
|
||||
}
|
||||
}
|
||||
if (!is_ours) {
|
||||
competing_link_ids.push_back(link_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue