aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/ext/transport/chttp2/transport/chttp2_transport.cc')
-rw-r--r--src/core/ext/transport/chttp2/transport/chttp2_transport.cc17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
index bd6fec6fbe..bc6fa0d0eb 100644
--- a/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
+++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.cc
@@ -813,11 +813,7 @@ static void set_write_state(grpc_chttp2_transport* t,
write_state_name(st), reason));
t->write_state = st;
if (st == GRPC_CHTTP2_WRITE_STATE_IDLE) {
- grpc_chttp2_stream* s;
- while (grpc_chttp2_list_pop_waiting_for_write_stream(t, &s)) {
- GRPC_CLOSURE_LIST_SCHED(&s->run_after_write);
- GRPC_CHTTP2_STREAM_UNREF(s, "chttp2:write_closure_sched");
- }
+ GRPC_CLOSURE_LIST_SCHED(&t->run_after_write);
if (t->close_transport_on_writes_finished != nullptr) {
grpc_error* err = t->close_transport_on_writes_finished;
t->close_transport_on_writes_finished = nullptr;
@@ -1208,14 +1204,11 @@ void grpc_chttp2_complete_closure_step(grpc_chttp2_transport* t,
grpc_error_add_child(closure->error_data.error, error);
}
if (closure->next_data.scratch < CLOSURE_BARRIER_FIRST_REF_BIT) {
- if (s->seen_error || (t->write_state == GRPC_CHTTP2_WRITE_STATE_IDLE) ||
+ if ((t->write_state == GRPC_CHTTP2_WRITE_STATE_IDLE) ||
!(closure->next_data.scratch & CLOSURE_BARRIER_MAY_COVER_WRITE)) {
GRPC_CLOSURE_RUN(closure, closure->error_data.error);
} else {
- if (grpc_chttp2_list_add_waiting_for_write_stream(t, s)) {
- GRPC_CHTTP2_STREAM_REF(s, "chttp2:pending_write_closure");
- }
- grpc_closure_list_append(&s->run_after_write, closure,
+ grpc_closure_list_append(&t->run_after_write, closure,
closure->error_data.error);
}
}
@@ -2016,10 +2009,6 @@ static void remove_stream(grpc_chttp2_transport* t, uint32_t id,
void grpc_chttp2_cancel_stream(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
grpc_error* due_to_error) {
- GRPC_CLOSURE_LIST_SCHED(&s->run_after_write);
- if (grpc_chttp2_list_remove_waiting_for_write_stream(t, s)) {
- GRPC_CHTTP2_STREAM_UNREF(s, "chttp2:pending_write_closure");
- }
if (!t->is_client && !s->sent_trailing_metadata &&
grpc_error_has_clear_grpc_status(due_to_error)) {
close_from_api(t, s, due_to_error);