Skip to content

Commit f1f9503

Browse files
committed
Consistency improvement in stream keys API
1 parent 5171a63 commit f1f9503

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/controller/controller_api.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,7 @@ void Controller::handleAPICommands(JSON::Value &Request, JSON::Value &Response){
10001000
JSON::Value & keys = Controller::Storage["streamkeys"];
10011001
if (del.isObject()) {
10021002
jsonForEachConst (del, it) {
1003-
if (keys.isMember(it.key())) {
1003+
if (keys.isMember(it.key()) && keys[it.key()].asStringRef() == it->asString()) {
10041004
keys.removeMember(it.key());
10051005
rep.append(it.key());
10061006
}
@@ -1028,7 +1028,7 @@ void Controller::handleAPICommands(JSON::Value &Request, JSON::Value &Response){
10281028
JSON::Value & keys = Controller::Storage["streamkeys"];
10291029
JSON::Value & rep = Response["streamkey_add"]["added"];
10301030
jsonForEachConst (add, it) {
1031-
if (it->isString()) {
1031+
if (it->isString() && (!keys.isMember(it.key()) || keys[it.key()].asStringRef() != it->asStringRef())) {
10321032
keys[it.key()] = it->asStringRef();
10331033
rep.append(it.key());
10341034
}

0 commit comments

Comments
 (0)