Commit aa93ede6 authored by gejun's avatar gejun

Make HttpService.Echo in example/http_c++ as http service again

parent 7278f99d
...@@ -3,12 +3,8 @@ package example; ...@@ -3,12 +3,8 @@ package example;
option cc_generic_services = true; option cc_generic_services = true;
message HttpRequest { message HttpRequest {};
optional bytes message = 1; message HttpResponse {};
};
message HttpResponse {
optional bytes message = 1;
};
service HttpService { service HttpService {
rpc Echo(HttpRequest) returns (HttpResponse); rpc Echo(HttpRequest) returns (HttpResponse);
......
...@@ -58,16 +58,6 @@ public: ...@@ -58,16 +58,6 @@ public:
os << "\nbody: " << cntl->request_attachment() << '\n'; os << "\nbody: " << cntl->request_attachment() << '\n';
os.move_to(cntl->response_attachment()); os.move_to(cntl->response_attachment());
} }
void EchoProtobuf(google::protobuf::RpcController*,
const HttpRequest* request,
HttpResponse* response,
google::protobuf::Closure* done) {
// This object helps you to call done->Run() in RAII style. If you need
// to process the request asynchronously, pass done_guard.release().
brpc::ClosureGuard done_guard(done);
response->set_message(request->message());
}
}; };
// Service with dynamic path. // Service with dynamic path.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment