aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cpp
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2017-04-20 18:16:40 -0700
committerGravatar ncteisen <ncteisen@gmail.com>2017-04-21 08:06:12 -0700
commitcc7e17b2d6d015d88b94c0d3b089a65e0450614b (patch)
tree7fb9a0cf256dd0d190a1549769a39eca2e2b1e07 /src/cpp
parente107b0d439b3d394b8b60222b6e6afb256e67f5e (diff)
parentbcdf9e8d899bf5018978c4f3635c51df3f0c7d09 (diff)
Merge branch 'master' of https://github.com/grpc/grpc into serialization-refactor
Diffstat (limited to 'src/cpp')
-rw-r--r--src/cpp/client/channel_cc.cc2
-rw-r--r--src/cpp/client/client_context.cc2
-rw-r--r--src/cpp/client/generic_stub.cc2
-rw-r--r--src/cpp/common/core_codegen.cc6
-rw-r--r--src/cpp/server/server_cc.cc2
-rw-r--r--src/cpp/server/server_context.cc7
6 files changed, 14 insertions, 7 deletions
diff --git a/src/cpp/client/channel_cc.cc b/src/cpp/client/channel_cc.cc
index c985183ae7..fac1ba9d43 100644
--- a/src/cpp/client/channel_cc.cc
+++ b/src/cpp/client/channel_cc.cc
@@ -131,7 +131,7 @@ void Channel::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);
GPR_ASSERT(GRPC_CALL_OK ==
grpc_call_start_batch(call->call(), cops, nops, ops, nullptr));
}
diff --git a/src/cpp/client/client_context.cc b/src/cpp/client/client_context.cc
index 3d884cf62e..2516232840 100644
--- a/src/cpp/client/client_context.cc
+++ b/src/cpp/client/client_context.cc
@@ -74,7 +74,7 @@ ClientContext::ClientContext()
ClientContext::~ClientContext() {
if (call_) {
- grpc_call_destroy(call_);
+ grpc_call_unref(call_);
}
g_client_callbacks->Destructor(this);
}
diff --git a/src/cpp/client/generic_stub.cc b/src/cpp/client/generic_stub.cc
index 7a2fdf941c..4adb2a5359 100644
--- a/src/cpp/client/generic_stub.cc
+++ b/src/cpp/client/generic_stub.cc
@@ -42,7 +42,7 @@ std::unique_ptr<GenericClientAsyncReaderWriter> GenericStub::Call(
ClientContext* context, const grpc::string& method, CompletionQueue* cq,
void* tag) {
return std::unique_ptr<GenericClientAsyncReaderWriter>(
- new GenericClientAsyncReaderWriter(
+ GenericClientAsyncReaderWriter::Create(
channel_.get(), cq,
RpcMethod(method.c_str(), RpcMethod::BIDI_STREAMING), context, tag));
}
diff --git a/src/cpp/common/core_codegen.cc b/src/cpp/common/core_codegen.cc
index 3ece5aadde..abf07342fd 100644
--- a/src/cpp/common/core_codegen.cc
+++ b/src/cpp/common/core_codegen.cc
@@ -96,6 +96,12 @@ void CoreCodegen::grpc_byte_buffer_destroy(grpc_byte_buffer* bb) {
::grpc_byte_buffer_destroy(bb);
}
+void CoreCodegen::grpc_call_ref(grpc_call* call) { ::grpc_call_ref(call); }
+void CoreCodegen::grpc_call_unref(grpc_call* call) { ::grpc_call_unref(call); }
+void* CoreCodegen::grpc_call_arena_alloc(grpc_call* call, size_t length) {
+ return ::grpc_call_arena_alloc(call, length);
+}
+
int CoreCodegen::grpc_byte_buffer_reader_init(grpc_byte_buffer_reader* reader,
grpc_byte_buffer* buffer) {
return ::grpc_byte_buffer_reader_init(reader, buffer);
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();