diff options
author | David Garcia Quintas <dgq@google.com> | 2016-04-13 13:07:14 -0700 |
---|---|---|
committer | David Garcia Quintas <dgq@google.com> | 2016-04-13 13:07:14 -0700 |
commit | 2497064baa5d6e8a64f3bb24a0e57e8e9a03c3f5 (patch) | |
tree | 524f7667cc991b94ecf4b65a432d597cbf838041 /src/core | |
parent | 7d4f252c0ffc5a16dc17c7952a5d6f9a2c48e852 (diff) | |
parent | c2b6a0bcf98fb3d153e319a4be255da8540977c8 (diff) |
Merge branch 'master' of github.com:grpc/grpc into lr_hook
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/ext/transport/chttp2/transport/chttp2_transport.c | 4 | ||||
-rw-r--r-- | src/core/ext/transport/chttp2/transport/frame_data.c | 12 | ||||
-rw-r--r-- | src/core/ext/transport/chttp2/transport/frame_data.h | 3 |
3 files changed, 13 insertions, 6 deletions
diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c index b4cd185e62..01507f5ca6 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c @@ -1159,6 +1159,10 @@ static void cancel_from_api(grpc_exec_ctx *exec_ctx, grpc_chttp2_fake_status(exec_ctx, transport_global, stream_global, status, NULL); } + if (status != GRPC_STATUS_OK && !stream_global->seen_error) { + stream_global->seen_error = 1; + grpc_chttp2_list_add_check_read_ops(transport_global, stream_global); + } grpc_chttp2_mark_stream_closed(exec_ctx, transport_global, stream_global, 1, 1); } diff --git a/src/core/ext/transport/chttp2/transport/frame_data.c b/src/core/ext/transport/chttp2/transport/frame_data.c index 9c301d1608..3a6d80e0a3 100644 --- a/src/core/ext/transport/chttp2/transport/frame_data.c +++ b/src/core/ext/transport/chttp2/transport/frame_data.c @@ -159,7 +159,10 @@ grpc_chttp2_parse_error grpc_chttp2_data_parser_parse( } switch (p->state) { - fh_0: + case GRPC_CHTTP2_DATA_ERROR: + p->state = GRPC_CHTTP2_DATA_ERROR; + return GRPC_CHTTP2_STREAM_ERROR; + fh_0: case GRPC_CHTTP2_DATA_FH_0: stream_parsing->stats.incoming.framing_bytes++; p->frame_type = *cur; @@ -172,6 +175,7 @@ grpc_chttp2_parse_error grpc_chttp2_data_parser_parse( break; default: gpr_log(GPR_ERROR, "Bad GRPC frame type 0x%02x", p->frame_type); + p->state = GRPC_CHTTP2_DATA_ERROR; return GRPC_CHTTP2_STREAM_ERROR; } if (++cur == end) { @@ -218,13 +222,11 @@ grpc_chttp2_parse_error grpc_chttp2_data_parser_parse( message_flags, &p->incoming_frames); /* fallthrough */ case GRPC_CHTTP2_DATA_FRAME: + grpc_chttp2_list_add_parsing_seen_stream(transport_parsing, + stream_parsing); if (cur == end) { - grpc_chttp2_list_add_parsing_seen_stream(transport_parsing, - stream_parsing); return GRPC_CHTTP2_PARSE_OK; } - grpc_chttp2_list_add_parsing_seen_stream(transport_parsing, - stream_parsing); uint32_t remaining = (uint32_t)(end - cur); if (remaining == p->frame_size) { stream_parsing->stats.incoming.data_bytes += p->frame_size; diff --git a/src/core/ext/transport/chttp2/transport/frame_data.h b/src/core/ext/transport/chttp2/transport/frame_data.h index 2ff32963d6..af71f483a2 100644 --- a/src/core/ext/transport/chttp2/transport/frame_data.h +++ b/src/core/ext/transport/chttp2/transport/frame_data.h @@ -49,7 +49,8 @@ typedef enum { GRPC_CHTTP2_DATA_FH_2, GRPC_CHTTP2_DATA_FH_3, GRPC_CHTTP2_DATA_FH_4, - GRPC_CHTTP2_DATA_FRAME + GRPC_CHTTP2_DATA_FRAME, + GRPC_CHTTP2_DATA_ERROR } grpc_chttp2_stream_state; typedef struct grpc_chttp2_incoming_byte_stream |