|
|
|
@ -46,6 +46,7 @@ |
|
|
|
|
#include <grpc++/server_credentials.h> |
|
|
|
|
#include <grpc++/thread_pool_interface.h> |
|
|
|
|
|
|
|
|
|
#include "src/core/profiling/timers.h" |
|
|
|
|
#include "src/cpp/proto/proto_utils.h" |
|
|
|
|
#include "src/cpp/util/time.h" |
|
|
|
|
|
|
|
|
@ -123,10 +124,12 @@ class Server::SyncRequest GRPC_FINAL : public CompletionQueueTag { |
|
|
|
|
std::unique_ptr<grpc::protobuf::Message> req; |
|
|
|
|
std::unique_ptr<grpc::protobuf::Message> res; |
|
|
|
|
if (has_request_payload_) { |
|
|
|
|
GRPC_TIMER_MARK(DESER_PROTO_BEGIN, call_.call()); |
|
|
|
|
req.reset(method_->AllocateRequestProto()); |
|
|
|
|
if (!DeserializeProto(request_payload_, req.get())) { |
|
|
|
|
abort(); // for now
|
|
|
|
|
} |
|
|
|
|
GRPC_TIMER_MARK(DESER_PROTO_END, call_.call()); |
|
|
|
|
} |
|
|
|
|
if (has_response_payload_) { |
|
|
|
|
res.reset(method_->AllocateResponseProto()); |
|
|
|
@ -340,7 +343,9 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag { |
|
|
|
|
bool orig_status = *status; |
|
|
|
|
if (*status && request_) { |
|
|
|
|
if (payload_) { |
|
|
|
|
GRPC_TIMER_MARK(DESER_PROTO_BEGIN, call_); |
|
|
|
|
*status = DeserializeProto(payload_, request_); |
|
|
|
|
GRPC_TIMER_MARK(DESER_PROTO_END, call_); |
|
|
|
|
} else { |
|
|
|
|
*status = false; |
|
|
|
|
} |
|
|
|
|