diff options
author | Craig Tiller <ctiller@google.com> | 2017-04-20 19:24:11 +0000 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-04-20 19:24:11 +0000 |
commit | c4c296e2d8ad6b90f5e36e4739ae3d68c66ace1f (patch) | |
tree | d33adf934999da3bdfd61567b1698b10c5f164e9 /src/cpp/server | |
parent | dbc12105a3e9266dde57647ccc6340ea9c50fd2c (diff) | |
parent | 14ff003ae48f6bafe379e7590573834bc563a7cb (diff) |
Merge github.com:grpc/grpc into tsan-c++
Diffstat (limited to 'src/cpp/server')
-rw-r--r-- | src/cpp/server/server_cc.cc | 2 | ||||
-rw-r--r-- | src/cpp/server/server_context.cc | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/cpp/server/server_cc.cc b/src/cpp/server/server_cc.cc index 423f347acd..b4d6961db8 100644 --- a/src/cpp/server/server_cc.cc +++ b/src/cpp/server/server_cc.cc @@ -607,7 +607,7 @@ void Server::PerformOpsOnCall(CallOpSetInterface* ops, Call* call) { static const size_t MAX_OPS = 8; size_t nops = 0; grpc_op cops[MAX_OPS]; - ops->FillOps(cops, &nops); + ops->FillOps(call->call(), cops, &nops); auto result = grpc_call_start_batch(call->call(), cops, nops, ops, nullptr); GPR_ASSERT(GRPC_CALL_OK == result); } diff --git a/src/cpp/server/server_context.cc b/src/cpp/server/server_context.cc index 33ad0ae142..923556413e 100644 --- a/src/cpp/server/server_context.cc +++ b/src/cpp/server/server_context.cc @@ -62,7 +62,7 @@ class ServerContext::CompletionOp final : public CallOpSetInterface { finalized_(false), cancelled_(0) {} - void FillOps(grpc_op* ops, size_t* nops) override; + void FillOps(grpc_call* call, grpc_op* ops, size_t* nops) override; bool FinalizeResult(void** tag, bool* status) override; bool CheckCancelled(CompletionQueue* cq) { @@ -100,7 +100,8 @@ void ServerContext::CompletionOp::Unref() { } } -void ServerContext::CompletionOp::FillOps(grpc_op* ops, size_t* nops) { +void ServerContext::CompletionOp::FillOps(grpc_call* call, grpc_op* ops, + size_t* nops) { ops->op = GRPC_OP_RECV_CLOSE_ON_SERVER; ops->data.recv_close_on_server.cancelled = &cancelled_; ops->flags = 0; @@ -151,7 +152,7 @@ ServerContext::ServerContext(gpr_timespec deadline, grpc_metadata_array* arr) ServerContext::~ServerContext() { if (call_) { - grpc_call_destroy(call_); + grpc_call_unref(call_); } if (completion_op_) { completion_op_->Unref(); |