MCPcopy Create free account
hub / github.com/XpuOS/xsched / GetResponse

Method GetResponse

service/common/src/client.cpp:30–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30XResult Client::GetResponse(const httplib::Result &res, Json::Value &response)
31{
32 if (res.error() != httplib::Error::Success || res == nullptr) {
33 XWARN("failed to get response, error: %s", httplib::to_string(res.error()).c_str());
34 return kXSchedErrorBadResponse;
35 }
36
37 if (res->status != httplib::StatusCode::OK_200) {
38 XWARN("failed to list XQueues, response code: %d, message: %s",
39 res->status, res->body.c_str());
40 return kXSchedErrorBadResponse;
41 }
42
43 if (!json_reader_.parse(res->body, response, false)) {
44 XWARN("failed to parse response, message: %s", res->body.c_str());
45 return kXSchedErrorBadResponse;
46 }
47
48 return kXSchedSuccess;
49}
50
51XResult Client::QueryXQueues(std::vector<sched::XQueueStatus> &xqueue_status,
52 std::unordered_map<PID, std::string> &cmdlines)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected