Skip to content

Commit

Permalink
Solve the call-suppression problem earlier in the stack
Browse files Browse the repository at this point in the history
  • Loading branch information
vjpai committed Mar 3, 2015
1 parent 0823cb7 commit dbb7963
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/cpp/server/server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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_);
Expand All @@ -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
Expand Down

0 comments on commit dbb7963

Please sign in to comment.