diff options
author | David Garcia Quintas <dgq@google.com> | 2015-05-04 13:05:32 -0700 |
---|---|---|
committer | David Garcia Quintas <dgq@google.com> | 2015-05-04 13:05:32 -0700 |
commit | 925573c17f67bbb1474efcc86fe2a3ea8f519fa7 (patch) | |
tree | bcd55e62e128069298bd7231a2ba916ec7df743a /src/core/transport/chttp2_transport.c | |
parent | 7c2ba271f9ee6bb942d98262db27b72b23302ce5 (diff) | |
parent | 097e7bf63e57c1bc8ca8c5acc3ef7a3ba1f37bf4 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/core/transport/chttp2_transport.c')
-rw-r--r-- | src/core/transport/chttp2_transport.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/core/transport/chttp2_transport.c b/src/core/transport/chttp2_transport.c index 97e6bae4bb..46bed36ac4 100644 --- a/src/core/transport/chttp2_transport.c +++ b/src/core/transport/chttp2_transport.c @@ -538,6 +538,19 @@ static void init_transport(transport *t, grpc_transport_setup_callback setup, push_setting(t, GRPC_CHTTP2_SETTINGS_MAX_CONCURRENT_STREAMS, channel_args->args[i].value.integer); } + } else if (0 == strcmp(channel_args->args[i].key, + GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER)) { + if (channel_args->args[i].type != GRPC_ARG_INTEGER) { + gpr_log(GPR_ERROR, "%s: must be an integer", + GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER); + } else if ((t->next_stream_id & 1) != + (channel_args->args[i].value.integer & 1)) { + gpr_log(GPR_ERROR, "%s: low bit must be %d on %s", + GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER, t->next_stream_id & 1, + t->is_client ? "client" : "server"); + } else { + t->next_stream_id = channel_args->args[i].value.integer; + } } } } @@ -1783,7 +1796,7 @@ static int process_read(transport *t, gpr_slice slice) { /* fallthrough */ case DTS_FH_5: GPR_ASSERT(cur < end); - t->incoming_stream_id = (((gpr_uint32)*cur) << 24) & 0x7f; + t->incoming_stream_id = (((gpr_uint32)*cur) & 0x7f) << 24; if (++cur == end) { t->deframe_state = DTS_FH_6; return 1; |