From 36bb8a00067a15db55d72b4ce4f2784d3ebb5caa Mon Sep 17 00:00:00 2001
From: ncteisen <ncteisen@gmail.com>
Date: Wed, 5 Jul 2017 11:21:25 -0700
Subject: [PATCH] s/hanging/pending/g

---
 .../grpc++/impl/codegen/method_handler_impl.h |  8 +++---
 include/grpc++/impl/codegen/server_context.h  |  4 +--
 include/grpc++/impl/codegen/sync_stream.h     | 27 ++++++++++---------
 test/cpp/end2end/test_service_impl.h          |  1 -
 4 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/include/grpc++/impl/codegen/method_handler_impl.h b/include/grpc++/impl/codegen/method_handler_impl.h
index 6ec2836037..15e24bdcdc 100644
--- a/include/grpc++/impl/codegen/method_handler_impl.h
+++ b/include/grpc++/impl/codegen/method_handler_impl.h
@@ -141,8 +141,8 @@ class ServerStreamingHandler : public MethodHandler {
     }
     ops.ServerSendStatus(param.server_context->trailing_metadata_, status);
     param.call->PerformOps(&ops);
-    if (param.server_context->has_hanging_ops_) {
-      param.call->cq()->Pluck(&param.server_context->hanging_ops_);
+    if (param.server_context->has_pending_ops_) {
+      param.call->cq()->Pluck(&param.server_context->pending_ops_);
     }
     param.call->cq()->Pluck(&ops);
   }
@@ -188,8 +188,8 @@ class TemplatedBidiStreamingHandler : public MethodHandler {
     }
     ops.ServerSendStatus(param.server_context->trailing_metadata_, status);
     param.call->PerformOps(&ops);
-    if (param.server_context->has_hanging_ops_) {
-      param.call->cq()->Pluck(&param.server_context->hanging_ops_);
+    if (param.server_context->has_pending_ops_) {
+      param.call->cq()->Pluck(&param.server_context->pending_ops_);
     }
     param.call->cq()->Pluck(&ops);
   }
diff --git a/include/grpc++/impl/codegen/server_context.h b/include/grpc++/impl/codegen/server_context.h
index d7bd7323f2..d149987fa2 100644
--- a/include/grpc++/impl/codegen/server_context.h
+++ b/include/grpc++/impl/codegen/server_context.h
@@ -273,8 +273,8 @@ class ServerContext {
 
   uint32_t initial_metadata_flags() const { return 0; }
 
-  CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage> hanging_ops_;
-  bool has_hanging_ops_;
+  CallOpSet<CallOpSendInitialMetadata, CallOpSendMessage> pending_ops_;
+  bool has_pending_ops_;
   CompletionOp* completion_op_;
   bool has_notify_when_done_tag_;
   void* async_notify_when_done_tag_;
diff --git a/include/grpc++/impl/codegen/sync_stream.h b/include/grpc++/impl/codegen/sync_stream.h
index 677fa78d9e..3fa208963d 100644
--- a/include/grpc++/impl/codegen/sync_stream.h
+++ b/include/grpc++/impl/codegen/sync_stream.h
@@ -589,27 +589,27 @@ class ServerWriter final : public ServerWriterInterface<W> {
     if (options.is_last_message()) {
       options.set_buffer_hint();
     }
-    if (!ctx_->hanging_ops_.SendMessage(msg, options).ok()) {
+    if (!ctx_->pending_ops_.SendMessage(msg, options).ok()) {
       return false;
     }
     if (!ctx_->sent_initial_metadata_) {
-      ctx_->hanging_ops_.SendInitialMetadata(ctx_->initial_metadata_,
+      ctx_->pending_ops_.SendInitialMetadata(ctx_->initial_metadata_,
                                              ctx_->initial_metadata_flags());
       if (ctx_->compression_level_set()) {
-        ctx_->hanging_ops_.set_compression_level(ctx_->compression_level());
+        ctx_->pending_ops_.set_compression_level(ctx_->compression_level());
       }
       ctx_->sent_initial_metadata_ = true;
     }
-    call_->PerformOps(&ctx_->hanging_ops_);
+    call_->PerformOps(&ctx_->pending_ops_);
     // if this is the last message we defer the pluck until AFTER we start
     // the trailing md op. This prevents hangs. See
     // https://github.com/grpc/grpc/issues/11546
     if (options.is_last_message()) {
-      ctx_->has_hanging_ops_ = true;
+      ctx_->has_pending_ops_ = true;
       return true;
     }
-    ctx_->has_hanging_ops_ = false;
-    return call_->cq()->Pluck(&ctx_->hanging_ops_);
+    ctx_->has_pending_ops_ = false;
+    return call_->cq()->Pluck(&ctx_->pending_ops_);
   }
 
  private:
@@ -661,26 +661,27 @@ class ServerReaderWriterBody final {
     if (options.is_last_message()) {
       options.set_buffer_hint();
     }
-    if (!ctx_->hanging_ops_.SendMessage(msg, options).ok()) {
+    if (!ctx_->pending_ops_.SendMessage(msg, options).ok()) {
       return false;
     }
     if (!ctx_->sent_initial_metadata_) {
-      ctx_->hanging_ops_.SendInitialMetadata(ctx_->initial_metadata_,
+      ctx_->pending_ops_.SendInitialMetadata(ctx_->initial_metadata_,
                                              ctx_->initial_metadata_flags());
       if (ctx_->compression_level_set()) {
-        ctx_->hanging_ops_.set_compression_level(ctx_->compression_level());
+        ctx_->pending_ops_.set_compression_level(ctx_->compression_level());
       }
       ctx_->sent_initial_metadata_ = true;
     }
-    call_->PerformOps(&ctx_->hanging_ops_);
+    call_->PerformOps(&ctx_->pending_ops_);
     // if this is the last message we defer the pluck until AFTER we start
     // the trailing md op. This prevents hangs. See
     // https://github.com/grpc/grpc/issues/11546
     if (options.is_last_message()) {
-      ctx_->has_hanging_ops_ = true;
+      ctx_->has_pending_ops_ = true;
       return true;
     }
-    return call_->cq()->Pluck(&ctx_->hanging_ops_);
+    ctx_->has_pending_ops_ = false;
+    return call_->cq()->Pluck(&ctx_->pending_ops_);
   }
 
  private:
diff --git a/test/cpp/end2end/test_service_impl.h b/test/cpp/end2end/test_service_impl.h
index 3857549d6b..e485769bb2 100644
--- a/test/cpp/end2end/test_service_impl.h
+++ b/test/cpp/end2end/test_service_impl.h
@@ -29,7 +29,6 @@
 namespace grpc {
 namespace testing {
 
-// const int kNumResponseStreamsMsgs = 3;
 const int kServerDefaultResponseStreamsToSend = 3;
 const char* const kServerResponseStreamsToSend = "server_responses_to_send";
 const char* const kServerCancelAfterReads = "cancel_after_reads";
-- 
GitLab