Let's just move this whole sso check up to make code flow a bit easier to reason about

This commit is contained in:
Grant Limberg 2023-05-15 16:37:41 -07:00
parent 326f7f7254
commit fbeae3c468
No known key found for this signature in database
GPG key ID: 8F2F97D3BE8D7735

View file

@ -1781,21 +1781,7 @@ void EmbeddedNetworkController::_startThreads()
if (qe) {
try {
_request(qe->nwid,qe->fromAddr,qe->requestPacketId,qe->identity,qe->metaData);
if (!_db.get(qe->nwid, network, qe->identity.address().toInt(), member)) {
delete qe;
qe = nullptr;
continue;
}
} catch (std::exception &e) {
fprintf(stderr,"ERROR: exception in controller request handling thread: %s" ZT_EOL_S,e.what());
} catch ( ... ) {
fprintf(stderr,"ERROR: exception in controller request handling thread: unknown exception" ZT_EOL_S);
}
delete qe;
qe = nullptr;
}
}
if (_db.get(qe->nwid, network, qe->identity.address().toInt(), member)) {
bool networkSSOEnabled = OSUtils::jsonBool(network["ssoEnabled"], false);
if (networkSSOEnabled) {
int64_t now = OSUtils::now();
@ -1822,6 +1808,16 @@ void EmbeddedNetworkController::_startThreads()
}
}
}
} catch (std::exception &e) {
fprintf(stderr,"ERROR: exception in controller request handling thread: %s" ZT_EOL_S,e.what());
} catch ( ... ) {
fprintf(stderr,"ERROR: exception in controller request handling thread: unknown exception" ZT_EOL_S);
}
delete qe;
qe = nullptr;
}
}
}
});
}
}