Remove rawEasyMem
This commit is contained in:
parent
cb944e5623
commit
805129eeb6
@ -80,8 +80,3 @@ bool memory::getEasyMem(crow::json::wvalue& ret){
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool memory::getRawEasyMem(std::string& ret){
|
|
||||||
std::ifstream f (procmempath);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
@ -17,5 +17,4 @@ namespace memory{
|
|||||||
bool getProcMem(crow::json::wvalue&);
|
bool getProcMem(crow::json::wvalue&);
|
||||||
bool getRawProcMem(std::string&);
|
bool getRawProcMem(std::string&);
|
||||||
bool getEasyMem(crow::json::wvalue&);
|
bool getEasyMem(crow::json::wvalue&);
|
||||||
bool getRawEasyMem(std::string&);
|
|
||||||
}
|
}
|
||||||
|
@ -24,19 +24,12 @@ void setRoutes(crow::SimpleApp& app){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
CROW_ROUTE(app, "/mem")([](const crow::request& req){
|
CROW_ROUTE(app, "/mem")([](){
|
||||||
bool status;
|
bool status;
|
||||||
std::string accept = req.get_header_value("Accept");
|
|
||||||
|
|
||||||
std::transform(accept.begin(), accept.end(), accept.begin(), ::tolower);
|
|
||||||
|
|
||||||
if(accept == "text/plain"){
|
|
||||||
accept.clear();
|
|
||||||
} else {
|
|
||||||
crow::json::wvalue json;
|
crow::json::wvalue json;
|
||||||
status = memory::getEasyMem(json);
|
status = memory::getEasyMem(json);
|
||||||
return crow::response(status ? 200 : 503, json.dump());
|
return crow::response(status ? 200 : 503, json.dump());
|
||||||
}
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user