aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cpp
diff options
context:
space:
mode:
authorGravatar Craig Tiller <craig.tiller@gmail.com>2015-03-03 13:12:31 -0800
committerGravatar Craig Tiller <craig.tiller@gmail.com>2015-03-03 13:12:31 -0800
commitc82c36b4007bb94ba9c38324b0fc681e87ce2021 (patch)
tree6001b539336a00f9cb7c4d22eb350d1ed9ce541a /src/cpp
parent95fb8b125a273d1048b4a0cf8ce41c89cea4e189 (diff)
parentdbb79631eb7231d82114aecaa5d0c7d8be6d34a9 (diff)
Merge pull request #920 from vjpai/async-probs
Solving crashes in async tests
Diffstat (limited to 'src/cpp')
-rw-r--r--src/cpp/server/server.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc
index 17b97f6ecf..2a5a7fe5eb 100644
--- a/src/cpp/server/server.cc
+++ b/src/cpp/server/server.cc
@@ -324,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_);
@@ -343,7 +344,9 @@ class Server::AsyncRequest GRPC_FINAL : public CompletionQueueTag {
}
ctx_->call_ = call_;
Call call(call_, server_, cq_);
- ctx_->BeginCompletionOp(&call);
+ if (orig_status && call_) {
+ ctx_->BeginCompletionOp(&call);
+ }
// just the pointers inside call are copied here
stream_->BindCall(&call);
delete this;