Replace the deprecated grpc_call_accept calls with the equivalent two new

calls.
	Change on 2014/12/17 by yangg <yangg@google.com>
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=82368034
pull/1/merge
yangg 10 years ago committed by Nicolas Noble
parent 4cb93718c7
commit 081e2b0e63
  1. 3
      src/cpp/server/async_server_context.cc
  2. 6
      src/cpp/stream/stream_context.cc

@ -54,7 +54,8 @@ AsyncServerContext::AsyncServerContext(
AsyncServerContext::~AsyncServerContext() { grpc_call_destroy(call_); }
void AsyncServerContext::Accept(grpc_completion_queue* cq) {
grpc_call_accept(call_, cq, this, 0);
GPR_ASSERT(grpc_call_server_accept(call_, cq, this) == GRPC_CALL_OK);
GPR_ASSERT(grpc_call_server_end_initial_metadata(call_, 0) == GRPC_CALL_OK);
}
bool AsyncServerContext::StartRead(google::protobuf::Message* request) {

@ -89,8 +89,10 @@ void StreamContext::Start(bool buffered) {
} else {
// TODO(yangg) metadata needs to be added before accept
// TODO(yangg) correctly set flag to accept
grpc_call_error error = grpc_call_accept(call(), cq(), finished_tag(), 0);
GPR_ASSERT(GRPC_CALL_OK == error);
GPR_ASSERT(grpc_call_server_accept(call(), cq(), finished_tag()) ==
GRPC_CALL_OK);
GPR_ASSERT(grpc_call_server_end_initial_metadata(call(), 0) ==
GRPC_CALL_OK);
}
}

Loading…
Cancel
Save