diff options
author | yang-g <yangg@google.com> | 2015-12-08 10:31:48 -0800 |
---|---|---|
committer | yang-g <yangg@google.com> | 2015-12-08 10:31:48 -0800 |
commit | 0edc362f91dea54f0b094daddc589b25b94f31bb (patch) | |
tree | a0ea2aaa8a7e2bf3e5786e566111c99c119795d1 /src | |
parent | 0346883b0b0afe2ce25bc89918051b1dd7fcffb2 (diff) | |
parent | cf45f0a44e0d3449e964d0a559f1e3f565052eb7 (diff) |
Merge remote-tracking branch 'upstream/master' into fixit_channel_c
Diffstat (limited to 'src')
-rw-r--r-- | src/core/census/context.h | 6 | ||||
-rw-r--r-- | src/core/transport/chttp2/frame_data.c | 2 | ||||
-rw-r--r-- | src/core/transport/chttp2/hpack_parser.c | 22 |
3 files changed, 15 insertions, 15 deletions
diff --git a/src/core/census/context.h b/src/core/census/context.h index d9907d4da7..e45409a6b8 100644 --- a/src/core/census/context.h +++ b/src/core/census/context.h @@ -39,11 +39,7 @@ /* census_context is the in-memory representation of information needed to * maintain tracing, RPC statistics and resource usage information. */ struct census_context { - gpr_uint64 op_id; /* Operation identifier - unique per-context */ - gpr_uint64 trace_id; /* Globally unique trace identifier */ - /* TODO(aveitch) Add census tags: - const census_tag_set *tags; - */ + census_tag_set *tags; /* Opaque data structure for census tags. */ }; #endif /* GRPC_INTERNAL_CORE_CENSUS_CONTEXT_H */ diff --git a/src/core/transport/chttp2/frame_data.c b/src/core/transport/chttp2/frame_data.c index e07fbb2cc7..38fa990758 100644 --- a/src/core/transport/chttp2/frame_data.c +++ b/src/core/transport/chttp2/frame_data.c @@ -118,7 +118,7 @@ void grpc_chttp2_encode_data(gpr_uint32 id, gpr_slice_buffer *inbuf, hdr = gpr_slice_malloc(9); p = GPR_SLICE_START_PTR(hdr); - GPR_ASSERT(write_bytes < 16777316); + GPR_ASSERT(write_bytes < (1<<24)); *p++ = (gpr_uint8)(write_bytes >> 16); *p++ = (gpr_uint8)(write_bytes >> 8); *p++ = (gpr_uint8)(write_bytes); diff --git a/src/core/transport/chttp2/hpack_parser.c b/src/core/transport/chttp2/hpack_parser.c index e5453000ec..30f0d469e3 100644 --- a/src/core/transport/chttp2/hpack_parser.c +++ b/src/core/transport/chttp2/hpack_parser.c @@ -1418,15 +1418,19 @@ grpc_chttp2_parse_error grpc_chttp2_header_parser_parse( GPR_TIMER_END("grpc_chttp2_hpack_parser_parse", 0); return GRPC_CHTTP2_CONNECTION_ERROR; } - if (parser->is_boundary) { - stream_parsing - ->got_metadata_on_parse[stream_parsing->header_frames_received] = 1; - stream_parsing->header_frames_received++; - grpc_chttp2_list_add_parsing_seen_stream(transport_parsing, - stream_parsing); - } - if (parser->is_eof) { - stream_parsing->received_close = 1; + /* need to check for null stream: this can occur if we receive an invalid + stream id on a header */ + if (stream_parsing != NULL) { + if (parser->is_boundary) { + stream_parsing + ->got_metadata_on_parse[stream_parsing->header_frames_received] = 1; + stream_parsing->header_frames_received++; + grpc_chttp2_list_add_parsing_seen_stream(transport_parsing, + stream_parsing); + } + if (parser->is_eof) { + stream_parsing->received_close = 1; + } } parser->on_header = on_header_not_set; parser->on_header_user_data = NULL; |