diff options
author | 2018-09-06 13:44:51 -0700 | |
---|---|---|
committer | 2018-09-06 14:11:07 -0700 | |
commit | 33d87e3ffdedaef7c3d1a7a466d3a69fa51b23d1 (patch) | |
tree | 8e8742dc9fdfd720fd3d81b9419ac067f185c84f /src/core/ext | |
parent | 8a8ed0e7115a4c21fbdd40968d688faaba379f2c (diff) |
Fix internal_data to be the same size as the new grpc_linked_mdelem
Diffstat (limited to 'src/core/ext')
-rw-r--r-- | src/core/ext/transport/chttp2/transport/hpack_encoder.cc | 9 | ||||
-rw-r--r-- | src/core/ext/transport/chttp2/transport/hpack_encoder.h | 2 | ||||
-rw-r--r-- | src/core/ext/transport/chttp2/transport/writing.cc | 6 |
3 files changed, 11 insertions, 6 deletions
diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.cc b/src/core/ext/transport/chttp2/transport/hpack_encoder.cc index 9842131d96..c9ba74bf64 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_encoder.cc +++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.cc @@ -663,7 +663,7 @@ void grpc_chttp2_hpack_compressor_set_max_table_size( } void grpc_chttp2_encode_header(grpc_chttp2_hpack_compressor* c, - grpc_mdelem** extra_headers, + grpc_linked_mdelem** extra_headers, size_t extra_headers_size, grpc_metadata_batch* metadata, const grpc_encode_header_options* options, @@ -688,7 +688,12 @@ void grpc_chttp2_encode_header(grpc_chttp2_hpack_compressor* c, emit_advertise_table_size_change(c, &st); } for (size_t i = 0; i < extra_headers_size; ++i) { - hpack_enc(c, *extra_headers[i], &st); + grpc_linked_mdelem* linked_md = extra_headers[i]; + if (is_valid_mdelem_index(linked_md->md_index)) { + emit_indexed(c, linked_md->md_index, &st); + } else { + hpack_enc(c, linked_md->md, &st); + } } grpc_metadata_batch_assert_ok(metadata); for (grpc_linked_mdelem* l = metadata->list.head; l; l = l->next) { diff --git a/src/core/ext/transport/chttp2/transport/hpack_encoder.h b/src/core/ext/transport/chttp2/transport/hpack_encoder.h index e31a7399d7..0994eeb45f 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_encoder.h +++ b/src/core/ext/transport/chttp2/transport/hpack_encoder.h @@ -87,7 +87,7 @@ typedef struct { } grpc_encode_header_options; void grpc_chttp2_encode_header(grpc_chttp2_hpack_compressor* c, - grpc_mdelem** extra_headers, + grpc_linked_mdelem** extra_headers, size_t extra_headers_size, grpc_metadata_batch* metadata, const grpc_encode_header_options* options, diff --git a/src/core/ext/transport/chttp2/transport/writing.cc b/src/core/ext/transport/chttp2/transport/writing.cc index 8b73b01dea..9eabdb4da4 100644 --- a/src/core/ext/transport/chttp2/transport/writing.cc +++ b/src/core/ext/transport/chttp2/transport/writing.cc @@ -557,12 +557,12 @@ class StreamWriteContext { if (s_->send_initial_metadata->idx.named.status != nullptr) { extra_headers_for_trailing_metadata_ [num_extra_headers_for_trailing_metadata_++] = - &s_->send_initial_metadata->idx.named.status->md; + s_->send_initial_metadata->idx.named.status; } if (s_->send_initial_metadata->idx.named.content_type != nullptr) { extra_headers_for_trailing_metadata_ [num_extra_headers_for_trailing_metadata_++] = - &s_->send_initial_metadata->idx.named.content_type->md; + s_->send_initial_metadata->idx.named.content_type; } } @@ -583,7 +583,7 @@ class StreamWriteContext { grpc_chttp2_transport* const t_; grpc_chttp2_stream* const s_; bool stream_became_writable_ = false; - grpc_mdelem* extra_headers_for_trailing_metadata_[2]; + grpc_linked_mdelem* extra_headers_for_trailing_metadata_[2]; size_t num_extra_headers_for_trailing_metadata_ = 0; }; } // namespace |