fixed RID alias updates not working via REST

pull/51/head
W3AXL 2 years ago
parent 12c9e266cc
commit 01bd534c8f

@ -83,13 +83,16 @@ void RadioIdLookup::addEntry(uint32_t id, bool enabled, const std::string& alias
std::lock_guard<std::mutex> lock(m_mutex); std::lock_guard<std::mutex> lock(m_mutex);
try { try {
RadioId _entry = m_table.at(id); RadioId _entry = m_table.at(id);
// if either the alias or the enabled flag doesn't match, update the entry
// if the enabled value doesn't match -- override with the intended if (_entry.radioEnabled() != enabled || _entry.radioAlias() != alias) {
if (_entry.radioEnabled() != enabled) { //LogDebug(LOG_HOST, "Updating existing RID %d (%s) in ACL", id, alias.c_str());
_entry = RadioId(enabled, false, alias); _entry = RadioId(enabled, false, alias);
m_table[id] = _entry; m_table[id] = _entry;
} else {
//LogDebug(LOG_HOST, "No changes made to RID %d (%s) in ACL", id, alias.c_str());
} }
} catch (...) { } catch (...) {
//LogDebug(LOG_HOST, "Adding new RID %d (%s) to ACL", id, alias.c_str());
m_table[id] = entry; m_table[id] = entry;
} }
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.