aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/transport/chttp2/writing.c
diff options
context:
space:
mode:
authorGravatar Julien Boeuf <jboeuf@google.com>2015-07-08 16:24:31 -0700
committerGravatar Julien Boeuf <jboeuf@google.com>2015-07-08 16:24:31 -0700
commitea94e46b0df7f1774eefea6654f1e26cc4484b00 (patch)
treeb6fdb9a22ac751a78305ffb2665e886f6b6d0063 /src/core/transport/chttp2/writing.c
parentfeca1bf06cf6ffd8d45b86c1c51f798bad9c52f4 (diff)
parent977565c2c0d67de0ab0c147fc6cd348a1e9ea419 (diff)
Merge branch 'master' of github.com:grpc/grpc into jwt_verifier
Diffstat (limited to 'src/core/transport/chttp2/writing.c')
-rw-r--r--src/core/transport/chttp2/writing.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/transport/chttp2/writing.c b/src/core/transport/chttp2/writing.c
index fdcc300099..a78654334e 100644
--- a/src/core/transport/chttp2/writing.c
+++ b/src/core/transport/chttp2/writing.c
@@ -97,12 +97,8 @@ int grpc_chttp2_unlocking_check_writes(
grpc_chttp2_list_add_writing_stream(transport_writing, stream_writing);
}
- /* we should either exhaust window or have no ops left, but not both */
- if (stream_global->outgoing_sopb->nops == 0) {
- stream_global->outgoing_sopb = NULL;
- grpc_chttp2_schedule_closure(transport_global,
- stream_global->send_done_closure, 1);
- } else if (stream_global->outgoing_window > 0) {
+ if (stream_global->outgoing_window > 0 &&
+ stream_global->outgoing_sopb->nops != 0) {
grpc_chttp2_list_add_writable_stream(transport_global, stream_global);
}
}
@@ -201,6 +197,11 @@ void grpc_chttp2_cleanup_writing(
while (grpc_chttp2_list_pop_written_stream(
transport_global, transport_writing, &stream_global, &stream_writing)) {
+ if (stream_global->outgoing_sopb->nops == 0) {
+ stream_global->outgoing_sopb = NULL;
+ grpc_chttp2_schedule_closure(transport_global,
+ stream_global->send_done_closure, 1);
+ }
if (stream_writing->send_closed != GRPC_DONT_SEND_CLOSED) {
stream_global->write_state = GRPC_WRITE_STATE_SENT_CLOSE;
if (!transport_global->is_client) {