aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-12-08 15:32:07 -0800
committerGravatar Craig Tiller <ctiller@google.com>2015-12-08 15:32:07 -0800
commitbe9e135d6ff5622e4526b7fa9a9df9abfa23bfaa (patch)
tree023c1f175ef4f455845942b1fb9045307e379a7b /src/core
parent30798c0fb9a5c86bf9d007f45e2837a66d0e22ee (diff)
parent248904afadfc8eb987d51abbb7f8ea216f548891 (diff)
Merge github.com:grpc/grpc into ping-ping-ping-ping-ping-ping-ping-ping-ping
Diffstat (limited to 'src/core')
-rw-r--r--src/core/census/context.h6
-rw-r--r--src/core/support/slice.c7
-rw-r--r--src/core/transport/chttp2/frame_data.c2
-rw-r--r--src/core/transport/chttp2/hpack_parser.c22
4 files changed, 15 insertions, 22 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/support/slice.c b/src/core/support/slice.c
index 5b091f17b0..9f0ded4932 100644
--- a/src/core/support/slice.c
+++ b/src/core/support/slice.c
@@ -341,10 +341,3 @@ int gpr_slice_str_cmp(gpr_slice a, const char *b) {
if (d != 0) return d;
return memcmp(GPR_SLICE_START_PTR(a), b, b_length);
}
-
-char *gpr_slice_to_cstring(gpr_slice slice) {
- char *result = gpr_malloc(GPR_SLICE_LENGTH(slice) + 1);
- memcpy(result, GPR_SLICE_START_PTR(slice), GPR_SLICE_LENGTH(slice));
- result[GPR_SLICE_LENGTH(slice)] = '\0';
- return result;
-}
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;