stroke: don't remove a matching peer config if used by other child configs
When configurations get merged during add, we should not remove peer configs if other connection entries use the same peer config.
This commit is contained in:
1 parent
11ac36b016
commit
791fde1669
1 file changed
+3
-4
@@ -1235,7 +1235,7 @@ METHOD(stroke_config_t, del, void,
|
||||
|
||||
this->mutex->lock(this->mutex);
|
||||
enumerator = this->list->create_enumerator(this->list);
|
||||
while (enumerator->enumerate(enumerator, (void**)&peer))
|
||||
while (enumerator->enumerate(enumerator, &peer))
|
||||
{
|
||||
bool keep = FALSE;
|
||||
|
||||
@@ -1256,12 +1256,11 @@ METHOD(stroke_config_t, del, void,
|
||||
}
|
||||
children->destroy(children);
|
||||
|
||||
/* if peer config matches, or has no children anymore, remove it */
|
||||
if (!keep || streq(peer->get_name(peer), msg->del_conn.name))
|
||||
/* if peer config has no children anymore, remove it */
|
||||
if (!keep)
|
||||
{
|
||||
this->list->remove_at(this->list, enumerator);
|
||||
peer->destroy(peer);
|
||||
deleted = TRUE;
|
||||
}
|
||||
}
|
||||
enumerator->destroy(enumerator);
|
||||
|
||||
Reference in new issue
Block a user