aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cpp/server
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2015-03-03 11:54:27 -0800
committerGravatar Vijay Pai <vpai@google.com>2015-03-03 11:54:27 -0800
commitdbb79631eb7231d82114aecaa5d0c7d8be6d34a9 (patch)
treec76f289083f02af2539b4360f5f3ddb8db271bc0 /src/cpp/server
parent0823cb786b873ce5e6d180dd279865742580e3a3 (diff)
Solve the call-suppression problem earlier in the stack
Diffstat (limited to 'src/cpp/server')
-rw-r--r--src/cpp/server/server.cc17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc
index 5c5b8d8286..f4410c12a5 100644
--- a/src/cpp/server/server.cc
+++ b/src/cpp/server/server.cc
@@ -287,14 +287,12 @@ void Server::Wait() {
}
void Server::PerformOpsOnCall(CallOpBuffer* buf, Call* call) {
- if (call->call()) {
- static const size_t MAX_OPS = 8;
- size_t nops = MAX_OPS;
- grpc_op ops[MAX_OPS];
- buf->FillOps(ops, &nops);
- GPR_ASSERT(GRPC_CALL_OK ==
- grpc_call_start_batch(call->call(), ops, nops, buf));
- }
+ static const size_t MAX_OPS = 8;
+ size_t nops = MAX_OPS;
+ grpc_op ops[MAX_OPS];
+ buf->FillOps(ops, &nops);
+ GPR_ASSERT(GRPC_CALL_OK ==
+ grpc_call_start_batch(call->call(), ops, nops, buf));
}
class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag {
@@ -326,6 +324,7 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag {
bool FinalizeResult(void** tag, bool* status) GRPC_OVERRIDE {
*tag = tag_;
+ bool orig_status = *status;
if (*status && request_) {
if (payload_) {
*status = DeserializeProto(payload_, request_);
@@ -345,7 +344,7 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag {
}
ctx_->call_ = call_;
Call call(call_, server_, cq_);
- if (call_) {
+ if (orig_status && call_) {
ctx_->BeginCompletionOp(&call);
}
// just the pointers inside call are copied here