Merge branch 'direct-calls' of github.com:ctiller/grpc into direct-calls

reviewable/pr8008/r7
Craig Tiller 8 years ago
commit f3d521814a
  1. 23
      src/core/ext/transport/chttp2/transport/parsing.c

@ -561,8 +561,9 @@ static grpc_error *init_header_frame_parser(grpc_exec_ctx *exec_ctx,
s = grpc_chttp2_parsing_lookup_stream(t, t->incoming_stream_id); s = grpc_chttp2_parsing_lookup_stream(t, t->incoming_stream_id);
if (s == NULL) { if (s == NULL) {
if (is_continuation) { if (is_continuation) {
GRPC_CHTTP2_IF_TRACING(
gpr_log(GPR_ERROR, gpr_log(GPR_ERROR,
"grpc_chttp2_stream disbanded before CONTINUATION received"); "grpc_chttp2_stream disbanded before CONTINUATION received"));
return init_skip_frame_parser(exec_ctx, t, 1); return init_skip_frame_parser(exec_ctx, t, 1);
} }
if (t->is_client) { if (t->is_client) {
@ -570,28 +571,31 @@ static grpc_error *init_header_frame_parser(grpc_exec_ctx *exec_ctx,
t->incoming_stream_id < t->next_stream_id) { t->incoming_stream_id < t->next_stream_id) {
/* this is an old (probably cancelled) grpc_chttp2_stream */ /* this is an old (probably cancelled) grpc_chttp2_stream */
} else { } else {
gpr_log(GPR_ERROR, GRPC_CHTTP2_IF_TRACING(gpr_log(
"ignoring new grpc_chttp2_stream creation on client"); GPR_ERROR, "ignoring new grpc_chttp2_stream creation on client"));
} }
return init_skip_frame_parser(exec_ctx, t, 1); return init_skip_frame_parser(exec_ctx, t, 1);
} else if (t->last_new_stream_id >= t->incoming_stream_id) { } else if (t->last_new_stream_id >= t->incoming_stream_id) {
gpr_log(GPR_ERROR, GRPC_CHTTP2_IF_TRACING(gpr_log(
GPR_ERROR,
"ignoring out of order new grpc_chttp2_stream request on server; " "ignoring out of order new grpc_chttp2_stream request on server; "
"last grpc_chttp2_stream " "last grpc_chttp2_stream "
"id=%d, new grpc_chttp2_stream id=%d", "id=%d, new grpc_chttp2_stream id=%d",
t->last_new_stream_id, t->incoming_stream_id); t->last_new_stream_id, t->incoming_stream_id));
return init_skip_frame_parser(exec_ctx, t, 1); return init_skip_frame_parser(exec_ctx, t, 1);
} else if ((t->incoming_stream_id & 1) == 0) { } else if ((t->incoming_stream_id & 1) == 0) {
gpr_log(GPR_ERROR, GRPC_CHTTP2_IF_TRACING(gpr_log(
GPR_ERROR,
"ignoring grpc_chttp2_stream with non-client generated index %d", "ignoring grpc_chttp2_stream with non-client generated index %d",
t->incoming_stream_id); t->incoming_stream_id));
return init_skip_frame_parser(exec_ctx, t, 1); return init_skip_frame_parser(exec_ctx, t, 1);
} }
t->last_new_stream_id = t->incoming_stream_id; t->last_new_stream_id = t->incoming_stream_id;
s = t->incoming_stream = s = t->incoming_stream =
grpc_chttp2_parsing_accept_stream(exec_ctx, t, t->incoming_stream_id); grpc_chttp2_parsing_accept_stream(exec_ctx, t, t->incoming_stream_id);
if (s == NULL) { if (s == NULL) {
gpr_log(GPR_ERROR, "grpc_chttp2_stream not accepted"); GRPC_CHTTP2_IF_TRACING(
gpr_log(GPR_ERROR, "grpc_chttp2_stream not accepted"));
return init_skip_frame_parser(exec_ctx, t, 1); return init_skip_frame_parser(exec_ctx, t, 1);
} }
} else { } else {
@ -600,7 +604,8 @@ static grpc_error *init_header_frame_parser(grpc_exec_ctx *exec_ctx,
GPR_ASSERT(s != NULL); GPR_ASSERT(s != NULL);
s->stats.incoming.framing_bytes += 9; s->stats.incoming.framing_bytes += 9;
if (s->read_closed) { if (s->read_closed) {
gpr_log(GPR_ERROR, "skipping already closed grpc_chttp2_stream header"); GRPC_CHTTP2_IF_TRACING(gpr_log(
GPR_ERROR, "skipping already closed grpc_chttp2_stream header"));
t->incoming_stream = NULL; t->incoming_stream = NULL;
return init_skip_frame_parser(exec_ctx, t, 1); return init_skip_frame_parser(exec_ctx, t, 1);
} }

Loading…
Cancel
Save