|
|
|
@ -501,7 +501,6 @@ static int init_stream(grpc_exec_ctx *exec_ctx, grpc_transport *gt, |
|
|
|
|
REF_TRANSPORT(t, "stream"); |
|
|
|
|
|
|
|
|
|
if (server_data) { |
|
|
|
|
GPR_ASSERT(t->executor.parsing_active); |
|
|
|
|
s->global.id = (uint32_t)(uintptr_t)server_data; |
|
|
|
|
s->global.outgoing_window = |
|
|
|
|
t->global.settings[GRPC_PEER_SETTINGS] |
|
|
|
@ -540,7 +539,7 @@ static void destroy_stream_locked(grpc_exec_ctx *exec_ctx, void *sp, |
|
|
|
|
exec_ctx, t, |
|
|
|
|
GRPC_ERROR_CREATE("Last stream closed after sending goaway")); |
|
|
|
|
} |
|
|
|
|
if (!t->executor.parsing_active && s->global.id) { |
|
|
|
|
if (s->global.id != 0) { |
|
|
|
|
GPR_ASSERT(grpc_chttp2_stream_map_find(&t->parsing_stream_map, |
|
|
|
|
s->global.id) == NULL); |
|
|
|
|
} |
|
|
|
@ -1246,15 +1245,6 @@ static void perform_transport_op_locked(grpc_exec_ctx *exec_ctx, |
|
|
|
|
grpc_chttp2_transport *t = op->transport_private.args[0]; |
|
|
|
|
grpc_error *close_transport = op->disconnect_with_error; |
|
|
|
|
|
|
|
|
|
/* If there's a set_accept_stream ensure that we're not parsing
|
|
|
|
|
to avoid changing things out from underneath */ |
|
|
|
|
if (t->executor.parsing_active && op->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)); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (op->on_connectivity_state_change != NULL) { |
|
|
|
|
grpc_connectivity_state_notify_on_state_change( |
|
|
|
|
exec_ctx, &t->channel_callback.state_tracker, op->connectivity_state, |
|
|
|
@ -1627,11 +1617,6 @@ void grpc_chttp2_mark_stream_closed( |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (stream_global->read_closed && stream_global->write_closed) { |
|
|
|
|
if (stream_global->id != 0 && |
|
|
|
|
TRANSPORT_FROM_GLOBAL(transport_global)->executor.parsing_active) { |
|
|
|
|
grpc_chttp2_list_add_closed_waiting_for_parsing(transport_global, |
|
|
|
|
stream_global); |
|
|
|
|
} else { |
|
|
|
|
if (stream_global->id != 0) { |
|
|
|
|
remove_stream(exec_ctx, TRANSPORT_FROM_GLOBAL(transport_global), |
|
|
|
|
stream_global->id, |
|
|
|
@ -1639,7 +1624,6 @@ void grpc_chttp2_mark_stream_closed( |
|
|
|
|
} |
|
|
|
|
GRPC_CHTTP2_STREAM_UNREF(exec_ctx, stream_global, "chttp2"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
GRPC_ERROR_UNREF(error); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -1874,9 +1858,7 @@ static void reading_action_locked(grpc_exec_ctx *exec_ctx, void *tp, |
|
|
|
|
|
|
|
|
|
GRPC_ERROR_REF(error); |
|
|
|
|
|
|
|
|
|
GPR_ASSERT(!t->executor.parsing_active); |
|
|
|
|
if (!t->closed) { |
|
|
|
|
t->executor.parsing_active = 1; |
|
|
|
|
/* merge stream lists */ |
|
|
|
|
grpc_chttp2_stream_map_move_into(&t->new_stream_map, |
|
|
|
|
&t->parsing_stream_map); |
|
|
|
@ -1919,27 +1901,6 @@ static void reading_action_locked(grpc_exec_ctx *exec_ctx, void *tp, |
|
|
|
|
grpc_chttp2_initiate_write(exec_ctx, transport_global, false, |
|
|
|
|
"global incoming window"); |
|
|
|
|
} |
|
|
|
|
t->executor.parsing_active = 0; |
|
|
|
|
/* handle delayed transport ops (if there is one) */ |
|
|
|
|
if (t->post_parsing_op) { |
|
|
|
|
grpc_transport_op *op = t->post_parsing_op; |
|
|
|
|
t->post_parsing_op = NULL; |
|
|
|
|
perform_transport_op_locked(exec_ctx, op, GRPC_ERROR_NONE); |
|
|
|
|
gpr_free(op); |
|
|
|
|
} |
|
|
|
|
/* if a stream is in the stream map, and gets cancelled, we need to
|
|
|
|
|
* ensure we are not parsing before continuing the cancellation to keep |
|
|
|
|
* things in a sane state */ |
|
|
|
|
grpc_chttp2_stream_global *stream_global; |
|
|
|
|
while (grpc_chttp2_list_pop_closed_waiting_for_parsing(transport_global, |
|
|
|
|
&stream_global)) { |
|
|
|
|
GPR_ASSERT(stream_global->in_stream_map); |
|
|
|
|
GPR_ASSERT(stream_global->write_closed); |
|
|
|
|
GPR_ASSERT(stream_global->read_closed); |
|
|
|
|
remove_stream(exec_ctx, t, stream_global->id, |
|
|
|
|
removal_error(GRPC_ERROR_NONE, stream_global)); |
|
|
|
|
GRPC_CHTTP2_STREAM_UNREF(exec_ctx, stream_global, "chttp2"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
GPR_TIMER_END("post_parse_locked", 0); |
|
|
|
|
} |
|
|
|
|