From 1bd9ea407fd673f6c795a524c6454bc5db339a85 Mon Sep 17 00:00:00 2001
From: Craig Tiller <ctiller@google.com>
Date: Thu, 3 Mar 2016 21:09:31 -0800
Subject: [PATCH] Refine condition

---
 src/core/transport/chttp2_transport.c | 5 +++--
 src/core/transport/transport.h        | 3 +--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c
index 369ff0ad7f..cf1dbfa0e5 100644
--- a/src/core/transport/chttp2_transport.c
+++ b/src/core/transport/chttp2_transport.c
@@ -1006,8 +1006,9 @@ static void perform_transport_op(grpc_exec_ctx *exec_ctx, grpc_transport *gt,
 
   lock(t);
 
-  /* Let's be overly cautious: don't change any state while we're parsing */
-  if (t->parsing_active) {
+  /* If there's a set_accept_stream ensure that we're not parsing
+     to avoid changing things out from underneath */
+  if (t->parsing_active && t->set_accept_stream) {
     GPR_ASSERT(t->post_parsing_op == NULL);
     t->post_parsing_op = gpr_malloc(sizeof(*op));
     memcpy(t->post_parsing_op, op, sizeof(*op));
diff --git a/src/core/transport/transport.h b/src/core/transport/transport.h
index 5a90bd6d38..ed6e121c9c 100644
--- a/src/core/transport/transport.h
+++ b/src/core/transport/transport.h
@@ -123,8 +123,7 @@ typedef struct grpc_transport_stream_op {
 
 /** Transport op: a set of operations to perform on a transport as a whole */
 typedef struct grpc_transport_op {
-  /** Called when processing of this op is done.
-      Only one transport_op is allowed to be outstanding at any time. */
+  /** Called when processing of this op is done. */
   grpc_closure *on_consumed;
   /** connectivity monitoring - set connectivity_state to NULL to unsubscribe */
   grpc_closure *on_connectivity_state_change;
-- 
GitLab