mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-04-16 12:06:55 +02:00
Minor fixes.
This commit is contained in:
parent
4868d21526
commit
360c84e035
2 changed files with 5 additions and 3 deletions
|
@ -1508,20 +1508,22 @@ unsigned int EmbeddedNetworkController::handleControlPlaneHttpDELETE(
|
|||
Mutex::Lock _l(_db_m);
|
||||
|
||||
json member = _db.get("network",nwids,"member",Address(address).toString(),0);
|
||||
if (!member.size())
|
||||
return 404;
|
||||
_db.erase("network",nwids,"member",Address(address).toString());
|
||||
|
||||
if (!member.size())
|
||||
return 404;
|
||||
responseBody = member.dump(2);
|
||||
responseContentType = "application/json";
|
||||
return 200;
|
||||
}
|
||||
} else {
|
||||
Mutex::Lock _l(_db_m);
|
||||
|
||||
std::string pfx("network/"); pfx.append(nwids);
|
||||
_db.filter(pfx,120000,[](const std::string &n,const json &obj) {
|
||||
return false; // delete
|
||||
});
|
||||
|
||||
responseBody = network.dump(2);
|
||||
responseContentType = "application/json";
|
||||
return 200;
|
||||
|
|
|
@ -79,7 +79,7 @@ public:
|
|||
{
|
||||
for(std::map<std::string,_E>::iterator i(_db.lower_bound(prefix));i!=_db.end();) {
|
||||
if ((i->first.length() >= prefix.length())&&(!memcmp(i->first.data(),prefix.data(),prefix.length()))) {
|
||||
if (!func(i->first,get(i->second.obj,maxSinceCheck))) {
|
||||
if (!func(i->first,get(i->first,maxSinceCheck))) {
|
||||
std::map<std::string,_E>::iterator i2(i); ++i2;
|
||||
this->erase(i->first);
|
||||
i = i2;
|
||||
|
|
Loading…
Add table
Reference in a new issue