mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-01-18 02:40:13 +00:00
Minor fixes.
This commit is contained in:
parent
4868d21526
commit
360c84e035
@ -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…
Reference in New Issue
Block a user