diff options
author | 2015-06-18 10:16:52 -0700 | |
---|---|---|
committer | 2015-06-18 10:16:52 -0700 | |
commit | c3fdaf9fd41918f09f7bab3413988cdd8f04eb4f (patch) | |
tree | 8cff21f6fac306638870aa7c9fe7744a1283c23e | |
parent | ac45370a137d733c7fcd61cafbff02f2fadfa55b (diff) |
Fix some list handling
-rw-r--r-- | src/core/transport/chttp2/writing.c | 6 | ||||
-rw-r--r-- | src/core/transport/chttp2_transport.c | 12 |
2 files changed, 12 insertions, 6 deletions
diff --git a/src/core/transport/chttp2/writing.c b/src/core/transport/chttp2/writing.c index 980af29552..5fbec8fdad 100644 --- a/src/core/transport/chttp2/writing.c +++ b/src/core/transport/chttp2/writing.c @@ -157,11 +157,7 @@ void grpc_chttp2_perform_writes( finalize_outbuf(transport_writing); GPR_ASSERT(transport_writing->outbuf.count > 0); - - if (!endpoint) { - grpc_chttp2_terminate_writing(transport_writing, 0); - return; - } + GPR_ASSERT(endpoint); switch (grpc_endpoint_write(endpoint, transport_writing->outbuf.slices, transport_writing->outbuf.count, finish_write_cb, diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index 902c15ad3e..215aac10a3 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -401,6 +401,7 @@ static int init_stream(grpc_transport *gt, grpc_stream *gs, static void destroy_stream(grpc_transport *gt, grpc_stream *gs) { grpc_chttp2_transport *t = (grpc_chttp2_transport *)gt; grpc_chttp2_stream *s = (grpc_chttp2_stream *)gs; + int i; gpr_mu_lock(&t->mu); @@ -413,8 +414,15 @@ static void destroy_stream(grpc_transport *gt, grpc_stream *gs) { s->global.id) == NULL); } + grpc_chttp2_list_remove_incoming_window_updated(&t->global, &s->global); + gpr_mu_unlock(&t->mu); + for (i = 0; i < STREAM_LIST_COUNT; i++) { + GPR_ASSERT(s->links[i].next == NULL); + GPR_ASSERT(s->links[i].prev == NULL); + } + GPR_ASSERT(s->global.outgoing_sopb == NULL); GPR_ASSERT(s->global.publish_sopb == NULL); grpc_sopb_destroy(&s->writing.sopb); @@ -709,13 +717,15 @@ static grpc_stream_state compute_state(gpr_uint8 write_closed, static void remove_stream(grpc_chttp2_transport *t, gpr_uint32 id) { grpc_chttp2_stream *s = grpc_chttp2_stream_map_delete(&t->parsing_stream_map, id); + if (!s) { + s = grpc_chttp2_stream_map_delete(&t->new_stream_map, id); + } GPR_ASSERT(s); s->global.in_stream_map = 0; if (t->parsing.incoming_stream == &s->parsing) { t->parsing.incoming_stream = NULL; grpc_chttp2_parsing_become_skip_parser(&t->parsing); } - grpc_chttp2_list_remove_incoming_window_updated(&t->global, &s->global); } static void unlock_check_read_write_state(grpc_chttp2_transport *t) { |