Fix some list handling

pull/2149/head
Craig Tiller 10 years ago
parent ac45370a13
commit c3fdaf9fd4
  1. 6
      src/core/transport/chttp2/writing.c
  2. 12
      src/core/transport/chttp2_transport.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,

@ -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) {

Loading…
Cancel
Save