rpcdb_srv.cpp 464 B

123456789101112131415161718192021222324252627282930
  1. #include <rpcdb.h>
  2. #include <server.h>
  3. #include <stdexcept>
  4. using std::exception;
  5. extern "C" {
  6. void init_server()
  7. {
  8. server_::init();
  9. }
  10. }
  11. response *rpc_call_1_svc(request *argp, struct svc_req *rqstp)
  12. {
  13. static response result;
  14. try {
  15. result = server_::execute(argp);
  16. } catch (exception &e) {
  17. memset(&result, 0, sizeof result);
  18. result.type = command_type::BAD_CMD;
  19. result.response_u.active.response = status::INVALID_REQUEST;
  20. }
  21. return &result;
  22. }