mirror of https://gitee.com/bigwinds/arangodb
Minor cleanup of routing code in HttpServer.
This commit is contained in:
parent
686f67024e
commit
16f2352a45
|
@ -243,12 +243,11 @@ HttpHandler* HttpHandlerFactory::createHandler (HttpRequest* request) {
|
||||||
return new MaintenanceHandler(request);
|
return new MaintenanceHandler(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
map<string, create_fptr> const& ii = _constructors;
|
unordered_map<string, create_fptr> const& ii = _constructors;
|
||||||
string path = request->requestPath();
|
string path = request->requestPath();
|
||||||
map<string, create_fptr>::const_iterator i = ii.find(path);
|
auto i = ii.find(path);
|
||||||
void* data = nullptr;
|
void* data = nullptr;
|
||||||
|
|
||||||
|
|
||||||
// no direct match, check prefix matches
|
// no direct match, check prefix matches
|
||||||
if (i == ii.end()) {
|
if (i == ii.end()) {
|
||||||
LOG_TRACE("no direct handler found, trying prefixes");
|
LOG_TRACE("no direct handler found, trying prefixes");
|
||||||
|
@ -335,8 +334,8 @@ HttpHandler* HttpHandlerFactory::createHandler (HttpRequest* request) {
|
||||||
|
|
||||||
|
|
||||||
// look up data
|
// look up data
|
||||||
map<string, void*> const& jj = _datas;
|
unordered_map<string, void*> const& jj = _datas;
|
||||||
map<string, void*>::const_iterator j = jj.find(path);
|
auto j = jj.find(path);
|
||||||
|
|
||||||
if (j != jj.end()) {
|
if (j != jj.end()) {
|
||||||
data = j->second;
|
data = j->second;
|
||||||
|
|
|
@ -249,29 +249,17 @@ namespace triagens {
|
||||||
|
|
||||||
void* _setContextData;
|
void* _setContextData;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
/// @brief authentication lock for cache
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
basics::ReadWriteLock _authLock;
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
/// @brief authentication cache
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
||||||
std::map<std::string, std::string> _authCache;
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief list of constructors
|
/// @brief list of constructors
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
std::map<std::string, create_fptr> _constructors;
|
std::unordered_map<std::string, create_fptr> _constructors;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief list of data pointers for constructors
|
/// @brief list of data pointers for constructors
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
std::map<std::string, void*> _datas;
|
std::unordered_map<std::string, void*> _datas;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief list of prefix handlers
|
/// @brief list of prefix handlers
|
||||||
|
|
Loading…
Reference in New Issue