void admin_process_request(struct response *rsp, struct request *req) { switch (req->type) { case REQ_STATS: _admin_stats(rsp, req); break; case REQ_VERSION: _admin_version(rsp, req); break; default: rsp->type = RSP_INVALID; break; } }
void admin_process_request(struct response *rsp, struct request *req) { rsp->type = RSP_GENERIC; switch (req->type) { case REQ_STATS: _admin_stats(rsp, req); break; case REQ_VERSION: rsp->data = str2bstr(VERSION_PRINTED); break; default: rsp->type = RSP_INVALID; break; } }