Reland slice metadata conversion (#28210)

* Fix status code for resource exhaustion

* Revert "Revert "Move a bunch of slice typed metadata to new system (#28107)" (#28208)"

This reverts commit 7717587063.

* fix test
pull/28222/head
Craig Tiller 3 years ago committed by GitHub
parent 9e3b364ee1
commit 220cf641fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      BUILD
  2. 2
      CMakeLists.txt
  3. 2
      Makefile
  4. 2
      build_autogenerated.yaml
  5. 1
      config.m4
  6. 1
      config.w32
  7. 1
      gRPC-Core.podspec
  8. 1
      grpc.gemspec
  9. 2
      grpc.gyp
  10. 1
      package.xml
  11. 7
      src/core/ext/filters/client_channel/backend_metric.cc
  12. 3
      src/core/ext/filters/client_channel/backend_metric.h
  13. 14
      src/core/ext/filters/client_channel/client_channel.cc
  14. 15
      src/core/ext/filters/http/client/http_client_filter.cc
  15. 34
      src/core/ext/filters/http/server/http_server_filter.cc
  16. 86
      src/core/ext/transport/binder/transport/binder_transport.cc
  17. 7
      src/core/ext/transport/chttp2/transport/chttp2_transport.cc
  18. 50
      src/core/ext/transport/chttp2/transport/hpack_encoder.cc
  19. 22
      src/core/ext/transport/chttp2/transport/hpack_encoder.h
  20. 1
      src/core/ext/transport/chttp2/transport/hpack_parser.cc
  21. 10
      src/core/lib/security/authorization/cel_authorization_engine.cc
  22. 23
      src/core/lib/security/authorization/evaluate_args.cc
  23. 1
      src/core/lib/security/authorization/evaluate_args.h
  24. 112
      src/core/lib/slice/percent_encoding.cc
  25. 16
      src/core/lib/slice/percent_encoding.h
  26. 33
      src/core/lib/slice/slice.h
  27. 636
      src/core/lib/slice/static_slice.cc
  28. 211
      src/core/lib/slice/static_slice.h
  29. 87
      src/core/lib/surface/call.cc
  30. 212
      src/core/lib/transport/metadata_batch.h
  31. 35
      src/core/lib/transport/parsed_metadata.cc
  32. 163
      src/core/lib/transport/parsed_metadata.h
  33. 658
      src/core/lib/transport/static_metadata.cc
  34. 14
      src/core/lib/transport/static_metadata.h
  35. 25
      src/cpp/ext/filters/census/client_filter.cc
  36. 43
      src/cpp/ext/filters/census/server_filter.cc
  37. 1
      src/python/grpcio/grpc_core_dependencies.py
  38. 11
      test/core/bad_client/tests/large_metadata.cc
  39. 10
      test/core/end2end/fuzzers/hpack.dictionary
  40. 11
      test/core/security/evaluate_args_test.cc
  41. 16
      test/core/slice/percent_decode_fuzzer.cc
  42. 23
      test/core/slice/percent_encode_fuzzer.cc
  43. 80
      test/core/slice/percent_encoding_test.cc
  44. 11
      test/core/util/evaluate_args_test_util.h
  45. 32
      test/cpp/microbenchmarks/bm_chttp2_hpack.cc
  46. 5
      test/cpp/util/grpc_tool_test.cc
  47. 17
      tools/codegen/core/gen_static_metadata.py
  48. 1
      tools/doxygen/Doxyfile.c++.internal
  49. 1
      tools/doxygen/Doxyfile.core.internal

@ -1854,6 +1854,7 @@ grpc_cc_library(
"src/core/lib/transport/error_utils.cc",
"src/core/lib/transport/metadata.cc",
"src/core/lib/transport/metadata_batch.cc",
"src/core/lib/transport/parsed_metadata.cc",
"src/core/lib/transport/pid_controller.cc",
"src/core/lib/transport/static_metadata.cc",
"src/core/lib/transport/status_conversion.cc",

2
CMakeLists.txt generated

@ -2054,6 +2054,7 @@ add_library(grpc
src/core/lib/transport/error_utils.cc
src/core/lib/transport/metadata.cc
src/core/lib/transport/metadata_batch.cc
src/core/lib/transport/parsed_metadata.cc
src/core/lib/transport/pid_controller.cc
src/core/lib/transport/static_metadata.cc
src/core/lib/transport/status_conversion.cc
@ -2643,6 +2644,7 @@ add_library(grpc_unsecure
src/core/lib/transport/error_utils.cc
src/core/lib/transport/metadata.cc
src/core/lib/transport/metadata_batch.cc
src/core/lib/transport/parsed_metadata.cc
src/core/lib/transport/pid_controller.cc
src/core/lib/transport/static_metadata.cc
src/core/lib/transport/status_conversion.cc

2
Makefile generated

@ -1589,6 +1589,7 @@ LIBGRPC_SRC = \
src/core/lib/transport/error_utils.cc \
src/core/lib/transport/metadata.cc \
src/core/lib/transport/metadata_batch.cc \
src/core/lib/transport/parsed_metadata.cc \
src/core/lib/transport/pid_controller.cc \
src/core/lib/transport/static_metadata.cc \
src/core/lib/transport/status_conversion.cc \
@ -2026,6 +2027,7 @@ LIBGRPC_UNSECURE_SRC = \
src/core/lib/transport/error_utils.cc \
src/core/lib/transport/metadata.cc \
src/core/lib/transport/metadata_batch.cc \
src/core/lib/transport/parsed_metadata.cc \
src/core/lib/transport/pid_controller.cc \
src/core/lib/transport/static_metadata.cc \
src/core/lib/transport/status_conversion.cc \

@ -1527,6 +1527,7 @@ libs:
- src/core/lib/transport/error_utils.cc
- src/core/lib/transport/metadata.cc
- src/core/lib/transport/metadata_batch.cc
- src/core/lib/transport/parsed_metadata.cc
- src/core/lib/transport/pid_controller.cc
- src/core/lib/transport/static_metadata.cc
- src/core/lib/transport/status_conversion.cc
@ -2268,6 +2269,7 @@ libs:
- src/core/lib/transport/error_utils.cc
- src/core/lib/transport/metadata.cc
- src/core/lib/transport/metadata_batch.cc
- src/core/lib/transport/parsed_metadata.cc
- src/core/lib/transport/pid_controller.cc
- src/core/lib/transport/static_metadata.cc
- src/core/lib/transport/status_conversion.cc

1
config.m4 generated

@ -642,6 +642,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/transport/error_utils.cc \
src/core/lib/transport/metadata.cc \
src/core/lib/transport/metadata_batch.cc \
src/core/lib/transport/parsed_metadata.cc \
src/core/lib/transport/pid_controller.cc \
src/core/lib/transport/static_metadata.cc \
src/core/lib/transport/status_conversion.cc \

1
config.w32 generated

@ -608,6 +608,7 @@ if (PHP_GRPC != "no") {
"src\\core\\lib\\transport\\error_utils.cc " +
"src\\core\\lib\\transport\\metadata.cc " +
"src\\core\\lib\\transport\\metadata_batch.cc " +
"src\\core\\lib\\transport\\parsed_metadata.cc " +
"src\\core\\lib\\transport\\pid_controller.cc " +
"src\\core\\lib\\transport\\static_metadata.cc " +
"src\\core\\lib\\transport\\status_conversion.cc " +

1
gRPC-Core.podspec generated

@ -1345,6 +1345,7 @@ Pod::Spec.new do |s|
'src/core/lib/transport/metadata.h',
'src/core/lib/transport/metadata_batch.cc',
'src/core/lib/transport/metadata_batch.h',
'src/core/lib/transport/parsed_metadata.cc',
'src/core/lib/transport/parsed_metadata.h',
'src/core/lib/transport/pid_controller.cc',
'src/core/lib/transport/pid_controller.h',

1
grpc.gemspec generated

@ -1265,6 +1265,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/transport/metadata.h )
s.files += %w( src/core/lib/transport/metadata_batch.cc )
s.files += %w( src/core/lib/transport/metadata_batch.h )
s.files += %w( src/core/lib/transport/parsed_metadata.cc )
s.files += %w( src/core/lib/transport/parsed_metadata.h )
s.files += %w( src/core/lib/transport/pid_controller.cc )
s.files += %w( src/core/lib/transport/pid_controller.h )

2
grpc.gyp generated

@ -1030,6 +1030,7 @@
'src/core/lib/transport/error_utils.cc',
'src/core/lib/transport/metadata.cc',
'src/core/lib/transport/metadata_batch.cc',
'src/core/lib/transport/parsed_metadata.cc',
'src/core/lib/transport/pid_controller.cc',
'src/core/lib/transport/static_metadata.cc',
'src/core/lib/transport/status_conversion.cc',
@ -1439,6 +1440,7 @@
'src/core/lib/transport/error_utils.cc',
'src/core/lib/transport/metadata.cc',
'src/core/lib/transport/metadata_batch.cc',
'src/core/lib/transport/parsed_metadata.cc',
'src/core/lib/transport/pid_controller.cc',
'src/core/lib/transport/static_metadata.cc',
'src/core/lib/transport/status_conversion.cc',

1
package.xml generated

@ -1245,6 +1245,7 @@
<file baseinstalldir="/" name="src/core/lib/transport/metadata.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/metadata_batch.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/metadata_batch.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/parsed_metadata.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/parsed_metadata.h" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/pid_controller.cc" role="src" />
<file baseinstalldir="/" name="src/core/lib/transport/pid_controller.h" role="src" />

@ -49,12 +49,11 @@ std::map<absl::string_view, double> ParseMap(
} // namespace
const LoadBalancingPolicy::BackendMetricAccessor::BackendMetricData*
ParseBackendMetricData(const grpc_slice& serialized_load_report, Arena* arena) {
ParseBackendMetricData(const Slice& serialized_load_report, Arena* arena) {
upb::Arena upb_arena;
xds_data_orca_v3_OrcaLoadReport* msg = xds_data_orca_v3_OrcaLoadReport_parse(
reinterpret_cast<const char*>(
GRPC_SLICE_START_PTR(serialized_load_report)),
GRPC_SLICE_LENGTH(serialized_load_report), upb_arena.ptr());
reinterpret_cast<const char*>(serialized_load_report.begin()),
serialized_load_report.size(), upb_arena.ptr());
if (msg == nullptr) return nullptr;
auto* backend_metric_data = arena->New<
LoadBalancingPolicy::BackendMetricAccessor::BackendMetricData>();

@ -23,13 +23,14 @@
#include "src/core/ext/filters/client_channel/lb_policy.h"
#include "src/core/lib/gprpp/arena.h"
#include "src/core/lib/slice/slice.h"
namespace grpc_core {
// Parses the serialized load report and allocates a BackendMetricData
// object on the arena.
const LoadBalancingPolicy::BackendMetricAccessor::BackendMetricData*
ParseBackendMetricData(const grpc_slice& serialized_load_report, Arena* arena);
ParseBackendMetricData(const Slice& serialized_load_report, Arena* arena);
} // namespace grpc_core

@ -2506,11 +2506,10 @@ class ClientChannel::LoadBalancedCall::BackendMetricAccessor
const BackendMetricData* GetBackendMetricData() override {
if (lb_call_->backend_metric_data_ == nullptr) {
grpc_linked_mdelem* md = lb_call_->recv_trailing_metadata_->legacy_index()
->named.x_endpoint_load_metrics_bin;
if (md != nullptr) {
if (const auto* md = lb_call_->recv_trailing_metadata_->get_pointer(
XEndpointLoadMetricsBinMetadata())) {
lb_call_->backend_metric_data_ =
ParseBackendMetricData(GRPC_MDVALUE(md->md), lb_call_->arena_);
ParseBackendMetricData(*md, lb_call_->arena_);
}
}
return lb_call_->backend_metric_data_;
@ -2877,14 +2876,15 @@ void ClientChannel::LoadBalancedCall::RecvTrailingMetadataReady(
status = absl::Status(static_cast<absl::StatusCode>(code), message);
} else {
// Get status from headers.
const auto& fields = self->recv_trailing_metadata_->legacy_index()->named;
const auto& md = *self->recv_trailing_metadata_;
const auto& fields = md.legacy_index()->named;
GPR_ASSERT(fields.grpc_status != nullptr);
grpc_status_code code =
grpc_get_status_code_from_metadata(fields.grpc_status->md);
if (code != GRPC_STATUS_OK) {
absl::string_view message;
if (fields.grpc_message != nullptr) {
message = StringViewFromSlice(GRPC_MDVALUE(fields.grpc_message->md));
if (const auto* grpc_message = md.get_pointer(GrpcMessageMetadata())) {
message = grpc_message->as_string_view();
}
status = absl::Status(static_cast<absl::StatusCode>(code), message);
}

@ -138,17 +138,10 @@ static grpc_error_handle client_filter_incoming_metadata(
}
}
if (b->legacy_index()->named.grpc_message != nullptr) {
grpc_slice pct_decoded_msg = grpc_core::PermissivePercentDecodeSlice(
GRPC_MDVALUE(b->legacy_index()->named.grpc_message->md));
if (grpc_slice_is_equivalent(
pct_decoded_msg,
GRPC_MDVALUE(b->legacy_index()->named.grpc_message->md))) {
grpc_slice_unref_internal(pct_decoded_msg);
} else {
grpc_metadata_batch_set_value(b->legacy_index()->named.grpc_message,
pct_decoded_msg);
}
if (grpc_core::Slice* grpc_message =
b->get_pointer(grpc_core::GrpcMessageMetadata())) {
*grpc_message =
grpc_core::PermissivePercentDecodeSlice(std::move(*grpc_message));
}
if (b->legacy_index()->named.content_type != nullptr) {

@ -104,18 +104,10 @@ struct channel_data {
} // namespace
static grpc_error_handle hs_filter_outgoing_metadata(grpc_metadata_batch* b) {
if (b->legacy_index()->named.grpc_message != nullptr) {
grpc_slice pct_encoded_msg = grpc_core::PercentEncodeSlice(
GRPC_MDVALUE(b->legacy_index()->named.grpc_message->md),
grpc_core::PercentEncodingType::Compatible);
if (grpc_slice_is_equivalent(
pct_encoded_msg,
GRPC_MDVALUE(b->legacy_index()->named.grpc_message->md))) {
grpc_slice_unref_internal(pct_encoded_msg);
} else {
grpc_metadata_batch_set_value(b->legacy_index()->named.grpc_message,
pct_encoded_msg);
}
if (grpc_core::Slice* grpc_message =
b->get_pointer(grpc_core::GrpcMessageMetadata())) {
*grpc_message = grpc_core::PercentEncodeSlice(
std::move(*grpc_message), grpc_core::PercentEncodingType::Compatible);
}
return GRPC_ERROR_NONE;
}
@ -306,19 +298,11 @@ static grpc_error_handle hs_filter_incoming_metadata(grpc_call_element* elem,
}
}
if (b->legacy_index()->named.host != nullptr &&
b->legacy_index()->named.authority == nullptr) {
grpc_linked_mdelem* el = b->legacy_index()->named.host;
grpc_mdelem md = GRPC_MDELEM_REF(el->md);
b->Remove(el);
hs_add_error(
error_name, &error,
grpc_metadata_batch_add_head(
b, el,
grpc_mdelem_from_slices(GRPC_MDSTR_AUTHORITY,
grpc_slice_ref_internal(GRPC_MDVALUE(md))),
GRPC_BATCH_AUTHORITY));
GRPC_MDELEM_UNREF(md);
if (b->legacy_index()->named.authority == nullptr) {
absl::optional<grpc_core::Slice> host = b->Take(grpc_core::HostMetadata());
if (host.has_value()) {
b->Append(":authority", std::move(*host));
}
}
if (b->legacy_index()->named.authority == nullptr) {

@ -319,6 +319,52 @@ static void recv_trailing_metadata_locked(void* arg,
GRPC_BINDER_STREAM_UNREF(gbs, "recv_trailing_metadata");
}
namespace grpc_binder {
namespace {
class MetadataEncoder {
public:
MetadataEncoder(bool is_client, Transaction* tx, Metadata* init_md)
: is_client_(is_client), tx_(tx), init_md_(init_md) {}
void Encode(grpc_mdelem md) {
absl::string_view key = grpc_core::StringViewFromSlice(GRPC_MDKEY(md));
absl::string_view value = grpc_core::StringViewFromSlice(GRPC_MDVALUE(md));
gpr_log(GPR_INFO, "send metadata key-value %s",
absl::StrCat(key, " ", value).c_str());
if (grpc_slice_eq(GRPC_MDKEY(md), GRPC_MDSTR_PATH)) {
// TODO(b/192208403): Figure out if it is correct to simply drop '/'
// prefix and treat it as rpc method name
GPR_ASSERT(value[0] == '/');
std::string path = std::string(value).substr(1);
// Only client send method ref.
GPR_ASSERT(is_client_);
tx_->SetMethodRef(path);
} else if (grpc_slice_eq(GRPC_MDKEY(md), GRPC_MDSTR_GRPC_STATUS)) {
int status = grpc_get_status_code_from_metadata(md);
gpr_log(GPR_INFO, "send trailing metadata status = %d", status);
tx_->SetStatus(status);
} else {
init_md_->emplace_back(std::string(key), std::string(value));
}
}
template <typename Trait>
void Encode(Trait, const typename Trait::ValueType& value) {
init_md_->emplace_back(std::string(Trait::key()),
std::string(Trait::Encode(value).as_string_view()));
}
private:
const bool is_client_;
Transaction* const tx_;
Metadata* const init_md_;
};
} // namespace
} // namespace grpc_binder
static void perform_stream_op_locked(void* stream_op,
grpc_error_handle /*error*/) {
grpc_transport_stream_op_batch* op =
@ -386,25 +432,8 @@ static void perform_stream_op_locked(void* stream_op,
grpc_binder::Metadata init_md;
auto batch = op->payload->send_initial_metadata.send_initial_metadata;
batch->ForEach([&](grpc_mdelem md) {
absl::string_view key = grpc_core::StringViewFromSlice(GRPC_MDKEY(md));
absl::string_view value =
grpc_core::StringViewFromSlice(GRPC_MDVALUE(md));
gpr_log(GPR_INFO, "send initial metatday key-value %s",
absl::StrCat(key, " ", value).c_str());
if (grpc_slice_eq(GRPC_MDKEY(md), GRPC_MDSTR_PATH)) {
// TODO(b/192208403): Figure out if it is correct to simply drop '/'
// prefix and treat it as rpc method name
GPR_ASSERT(value[0] == '/');
std::string path = std::string(value).substr(1);
// Only client send method ref.
GPR_ASSERT(gbt->is_client);
tx.SetMethodRef(path);
} else {
init_md.emplace_back(std::string(key), std::string(value));
}
});
grpc_binder::MetadataEncoder encoder(gbt->is_client, &tx, &init_md);
batch->Encode(&encoder);
tx.SetPrefix(init_md);
}
if (op->send_message) {
@ -438,23 +467,10 @@ static void perform_stream_op_locked(void* stream_op,
auto batch = op->payload->send_trailing_metadata.send_trailing_metadata;
grpc_binder::Metadata trailing_metadata;
batch->ForEach([&](grpc_mdelem md) {
// Client will not send trailing metadata.
GPR_ASSERT(!gbt->is_client);
grpc_binder::MetadataEncoder encoder(gbt->is_client, &tx,
&trailing_metadata);
batch->Encode(&encoder);
if (grpc_slice_eq(GRPC_MDKEY(md), GRPC_MDSTR_GRPC_STATUS)) {
int status = grpc_get_status_code_from_metadata(md);
gpr_log(GPR_INFO, "send trailing metadata status = %d", status);
tx.SetStatus(status);
} else {
absl::string_view key = grpc_core::StringViewFromSlice(GRPC_MDKEY(md));
absl::string_view value =
grpc_core::StringViewFromSlice(GRPC_MDVALUE(md));
gpr_log(GPR_INFO, "send trailing metatday key-value %s",
absl::StrCat(key, " ", value).c_str());
trailing_metadata.emplace_back(std::string(key), std::string(value));
}
});
// TODO(mingcl): Will we ever has key-value pair here? According to
// wireformat client suffix data is always empty.
tx.SetSuffix(trailing_metadata);

@ -2102,10 +2102,9 @@ void grpc_chttp2_fake_status(grpc_chttp2_transport* t, grpc_chttp2_stream* s,
GRPC_MDSTR_GRPC_STATUS,
grpc_core::UnmanagedMemorySlice(status_string)));
if (!message.empty()) {
grpc_slice message_slice = grpc_slice_from_cpp_string(std::move(message));
GRPC_LOG_IF_ERROR("add_status_message",
s->trailing_metadata_buffer.ReplaceOrAppend(
GRPC_MDSTR_GRPC_MESSAGE, message_slice));
s->trailing_metadata_buffer.Set(
grpc_core::GrpcMessageMetadata(),
grpc_core::Slice::FromCopiedBuffer(message));
}
s->published_metadata[1] = GRPC_METADATA_SYNTHESIZED_FROM_FAKE;
grpc_chttp2_maybe_complete_recv_trailing_metadata(t, s);

@ -265,6 +265,32 @@ class StringValue {
VarintWriter<1> len_val_;
};
class BinaryStringValue {
public:
explicit BinaryStringValue(const grpc_slice& value,
bool use_true_binary_metadata)
: wire_value_(GetWireValue(value, use_true_binary_metadata, true)),
len_val_(wire_value_.length) {}
size_t prefix_length() const {
return len_val_.length() +
(wire_value_.insert_null_before_wire_value ? 1 : 0);
}
void WritePrefix(uint8_t* prefix_data) {
len_val_.Write(wire_value_.huffman_prefix, prefix_data);
if (wire_value_.insert_null_before_wire_value) {
prefix_data[len_val_.length()] = 0;
}
}
const grpc_slice& data() { return wire_value_.data; }
private:
WireValue wire_value_;
VarintWriter<1> len_val_;
};
class NonBinaryStringValue {
public:
explicit NonBinaryStringValue(const grpc_slice& value)
@ -356,6 +382,30 @@ void HPackCompressor::Framer::EmitLitHdrWithStringKeyNotIdx(grpc_mdelem elem) {
Add(emit.data());
}
void HPackCompressor::Framer::EmitLitHdrWithBinaryStringKeyNotIdx(
const grpc_slice& key_slice, const grpc_slice& value_slice) {
GRPC_STATS_INC_HPACK_SEND_LITHDR_NOTIDX_V();
GRPC_STATS_INC_HPACK_SEND_UNCOMPRESSED();
StringKey key(key_slice);
key.WritePrefix(0x00, AddTiny(key.prefix_length()));
Add(grpc_slice_ref_internal(key.key()));
BinaryStringValue emit(value_slice, use_true_binary_metadata_);
emit.WritePrefix(AddTiny(emit.prefix_length()));
Add(emit.data());
}
void HPackCompressor::Framer::EmitLitHdrWithNonBinaryStringKeyNotIdx(
const grpc_slice& key_slice, const grpc_slice& value_slice) {
GRPC_STATS_INC_HPACK_SEND_LITHDR_NOTIDX_V();
GRPC_STATS_INC_HPACK_SEND_UNCOMPRESSED();
StringKey key(key_slice);
key.WritePrefix(0x00, AddTiny(key.prefix_length()));
Add(grpc_slice_ref_internal(key.key()));
NonBinaryStringValue emit(value_slice);
emit.WritePrefix(AddTiny(emit.prefix_length()));
Add(grpc_slice_ref_internal(emit.data()));
}
void HPackCompressor::Framer::AdvertiseTableSizeChange() {
VarintWriter<3> w(compressor_->table_.max_size());
w.Write(0x20, AddTiny(w.length()));

@ -120,6 +120,24 @@ class HPackCompressor {
void Encode(GrpcTimeoutMetadata, grpc_millis deadline);
void Encode(TeMetadata, TeMetadata::ValueType value);
void Encode(UserAgentMetadata, const Slice& slice);
void Encode(GrpcMessageMetadata, const Slice& slice) {
if (slice.empty()) return;
EmitLitHdrWithNonBinaryStringKeyNotIdx(
StaticSlice::FromStaticString("grpc-message").c_slice(),
slice.c_slice());
}
template <typename Which>
void Encode(Which, const Slice& slice) {
if (absl::EndsWith(Which::key(), "-bin")) {
EmitLitHdrWithBinaryStringKeyNotIdx(
StaticSlice::FromStaticString(Which::key()).c_slice(),
slice.c_slice());
} else {
EmitLitHdrWithNonBinaryStringKeyNotIdx(
StaticSlice::FromStaticString(Which::key()).c_slice(),
slice.c_slice());
}
}
private:
struct FramePrefix {
@ -144,6 +162,10 @@ class HPackCompressor {
void EmitLitHdrWithStringKeyIncIdx(grpc_mdelem elem);
void EmitLitHdrWithNonBinaryStringKeyIncIdx(const grpc_slice& key_slice,
const grpc_slice& value_slice);
void EmitLitHdrWithBinaryStringKeyNotIdx(const grpc_slice& key_slice,
const grpc_slice& value_slice);
void EmitLitHdrWithNonBinaryStringKeyNotIdx(const grpc_slice& key_slice,
const grpc_slice& value_slice);
void EmitLitHdrWithStringKeyNotIdx(grpc_mdelem elem);
void EncodeAlwaysIndexed(uint32_t* index, const grpc_slice& key,

@ -1219,6 +1219,7 @@ class HPackParser::Parser {
" vs. %" PRIu32
"). GRPC_ARG_MAX_METADATA_SIZE can be set to increase this limit.",
*frame_length_, metadata_size_limit_);
if (metadata_buffer_ != nullptr) metadata_buffer_->Clear();
return input_->MaybeSetErrorAndReturn(
[] {
return grpc_error_set_int(

@ -115,17 +115,17 @@ std::unique_ptr<mock_cel::Activation> CelAuthorizationEngine::CreateActivation(
mock_cel::CelValue::CreateStringView(method));
}
} else if (elem == kHeaders) {
std::multimap<absl::string_view, absl::string_view> headers =
args.GetHeaders();
std::vector<std::pair<mock_cel::CelValue, mock_cel::CelValue>>
header_items;
for (const auto& header_key : header_keys_) {
auto header_item = headers.find(header_key);
if (header_item != headers.end()) {
std::string temp_value;
absl::optional<absl::string_view> header_value =
args.GetHeaderValue(header_key, &temp_value);
if (header_value.has_value()) {
header_items.push_back(
std::pair<mock_cel::CelValue, mock_cel::CelValue>(
mock_cel::CelValue::CreateStringView(header_key),
mock_cel::CelValue::CreateStringView(header_item->second)));
mock_cel::CelValue::CreateStringView(*header_value)));
}
}
headers_ = mock_cel::ContainerBackedMapImpl::Create(

@ -91,11 +91,10 @@ absl::string_view EvaluateArgs::GetPath() const {
absl::string_view EvaluateArgs::GetHost() const {
absl::string_view host;
if (metadata_ != nullptr &&
metadata_->legacy_index()->named.host != nullptr) {
grpc_linked_mdelem* elem = metadata_->legacy_index()->named.host;
const grpc_slice& val = GRPC_MDVALUE(elem->md);
host = StringViewFromSlice(val);
if (metadata_ != nullptr) {
if (auto* host_md = metadata_->get_pointer(HostMetadata())) {
host = host_md->as_string_view();
}
}
return host;
}
@ -111,20 +110,6 @@ absl::string_view EvaluateArgs::GetMethod() const {
return method;
}
std::multimap<absl::string_view, absl::string_view> EvaluateArgs::GetHeaders()
const {
std::multimap<absl::string_view, absl::string_view> headers;
if (metadata_ == nullptr) {
return headers;
}
metadata_->ForEach([&](grpc_mdelem md) {
const grpc_slice& key = GRPC_MDKEY(md);
const grpc_slice& val = GRPC_MDVALUE(md);
headers.emplace(StringViewFromSlice(key), StringViewFromSlice(val));
});
return headers;
}
absl::optional<absl::string_view> EvaluateArgs::GetHeaderValue(
absl::string_view key, std::string* concatenated_value) const {
if (metadata_ == nullptr) {

@ -58,7 +58,6 @@ class EvaluateArgs {
absl::string_view GetPath() const;
absl::string_view GetHost() const;
absl::string_view GetMethod() const;
std::multimap<absl::string_view, absl::string_view> GetHeaders() const;
// Returns metadata value(s) for the specified key.
// If the key is not present in the batch, returns absl::nullopt.
// If the key is present exactly once in the batch, returns a string_view of

@ -78,135 +78,79 @@ const BitSet<256>& LookupTableForPercentEncodingType(PercentEncodingType type) {
}
} // namespace
grpc_slice PercentEncodeSlice(const grpc_slice& slice,
PercentEncodingType type) {
Slice PercentEncodeSlice(Slice slice, PercentEncodingType type) {
static const uint8_t hex[] = "0123456789ABCDEF";
const BitSet<256>& lut = LookupTableForPercentEncodingType(type);
// first pass: count the number of bytes needed to output this string
size_t output_length = 0;
const uint8_t* slice_start = GRPC_SLICE_START_PTR(slice);
const uint8_t* slice_end = GRPC_SLICE_END_PTR(slice);
const uint8_t* p;
bool any_reserved_bytes = false;
for (p = slice_start; p < slice_end; p++) {
bool unres = lut.is_set(*p);
for (uint8_t c : slice) {
bool unres = lut.is_set(c);
output_length += unres ? 1 : 3;
any_reserved_bytes |= !unres;
}
// no unreserved bytes: return the string unmodified
if (!any_reserved_bytes) {
return grpc_slice_ref_internal(slice);
return slice;
}
// second pass: actually encode
grpc_slice out = GRPC_SLICE_MALLOC(output_length);
uint8_t* q = GRPC_SLICE_START_PTR(out);
for (p = slice_start; p < slice_end; p++) {
if (lut.is_set(*p)) {
*q++ = *p;
auto out = MutableSlice::CreateUninitialized(output_length);
uint8_t* q = out.begin();
for (uint8_t c : slice) {
if (lut.is_set(c)) {
*q++ = c;
} else {
*q++ = '%';
*q++ = hex[*p >> 4];
*q++ = hex[*p & 15];
*q++ = hex[c >> 4];
*q++ = hex[c & 15];
}
}
GPR_ASSERT(q == GRPC_SLICE_END_PTR(out));
return out;
GPR_ASSERT(q == out.end());
return Slice(std::move(out));
}
static bool valid_hex(const uint8_t* p, const uint8_t* end) {
static bool ValidHex(const uint8_t* p, const uint8_t* end) {
if (p >= end) return false;
return (*p >= '0' && *p <= '9') || (*p >= 'a' && *p <= 'f') ||
(*p >= 'A' && *p <= 'F');
}
static uint8_t dehex(uint8_t c) {
static uint8_t DeHex(uint8_t c) {
if (c >= '0' && c <= '9') return static_cast<uint8_t>(c - '0');
if (c >= 'A' && c <= 'F') return static_cast<uint8_t>(c - 'A' + 10);
if (c >= 'a' && c <= 'f') return static_cast<uint8_t>(c - 'a' + 10);
GPR_UNREACHABLE_CODE(return 255);
}
absl::optional<grpc_slice> PercentDecodeSlice(const grpc_slice& slice_in,
PercentEncodingType type) {
const uint8_t* p = GRPC_SLICE_START_PTR(slice_in);
const uint8_t* in_end = GRPC_SLICE_END_PTR(slice_in);
size_t out_length = 0;
Slice PermissivePercentDecodeSlice(Slice slice_in) {
bool any_percent_encoded_stuff = false;
const BitSet<256>& lut = LookupTableForPercentEncodingType(type);
while (p != in_end) {
if (*p == '%') {
if (!valid_hex(++p, in_end)) return {};
if (!valid_hex(++p, in_end)) return {};
p++;
out_length++;
for (uint8_t c : slice_in) {
if (c == '%') {
any_percent_encoded_stuff = true;
} else if (lut.is_set(*p)) {
p++;
out_length++;
} else {
return {};
}
}
if (!any_percent_encoded_stuff) {
return grpc_slice_ref_internal(slice_in);
}
p = GRPC_SLICE_START_PTR(slice_in);
grpc_slice slice_out = GRPC_SLICE_MALLOC(out_length);
uint8_t* q = GRPC_SLICE_START_PTR(slice_out);
while (p != in_end) {
if (*p == '%') {
*q++ = static_cast<uint8_t>(dehex(p[1]) << 4) | (dehex(p[2]));
p += 3;
} else {
*q++ = *p++;
break;
}
}
GPR_ASSERT(q == GRPC_SLICE_END_PTR(slice_out));
return slice_out;
}
if (!any_percent_encoded_stuff) return slice_in;
grpc_slice PermissivePercentDecodeSlice(const grpc_slice& slice_in) {
const uint8_t* p = GRPC_SLICE_START_PTR(slice_in);
const uint8_t* in_end = GRPC_SLICE_END_PTR(slice_in);
size_t out_length = 0;
bool any_percent_encoded_stuff = false;
while (p != in_end) {
if (*p == '%') {
if (!valid_hex(p + 1, in_end) || !valid_hex(p + 2, in_end)) {
p++;
out_length++;
} else {
p += 3;
out_length++;
any_percent_encoded_stuff = true;
}
} else {
p++;
out_length++;
}
}
if (!any_percent_encoded_stuff) {
return grpc_slice_ref_internal(slice_in);
}
p = GRPC_SLICE_START_PTR(slice_in);
grpc_slice out = GRPC_SLICE_MALLOC(out_length);
uint8_t* q = GRPC_SLICE_START_PTR(out);
while (p != in_end) {
MutableSlice out = slice_in.TakeMutable();
uint8_t* q = out.begin();
const uint8_t* p = out.begin();
const uint8_t* end = out.end();
while (p != end) {
if (*p == '%') {
if (!valid_hex(p + 1, in_end) || !valid_hex(p + 2, in_end)) {
if (!ValidHex(p + 1, end) || !ValidHex(p + 2, end)) {
*q++ = *p++;
} else {
*q++ = static_cast<uint8_t>(dehex(p[1]) << 4) | (dehex(p[2]));
*q++ = static_cast<uint8_t>(DeHex(p[1]) << 4) | (DeHex(p[2]));
p += 3;
}
} else {
*q++ = *p++;
}
}
GPR_ASSERT(q == GRPC_SLICE_END_PTR(out));
return out;
return Slice(out.TakeSubSlice(0, q - out.begin()));
}
} // namespace grpc_core

@ -34,32 +34,26 @@
#include <grpc/slice.h>
#include "src/core/lib/slice/slice.h"
namespace grpc_core {
enum class PercentEncodingType {
// Flags [A-Za-z0-9-_.~] as unreserved bytes for the percent encoding routines
URL,
// Flags ascii7 non-control characters excluding '%' as unreserved bytes for
// the
// percent encoding routines
// the percent encoding routines
Compatible
};
// Percent-encode a slice, returning the new slice (this cannot fail):
// unreserved_bytes is a bitfield indicating which bytes are considered
// unreserved and thus do not need percent encoding
grpc_slice PercentEncodeSlice(const grpc_slice& slice,
PercentEncodingType type);
// Percent-decode a slice, strictly.
// If the input is legal (contains no unreserved bytes, and legal % encodings),
// returns the decoded slice.
// If the input is not legal, returns {}.
absl::optional<grpc_slice> PercentDecodeSlice(const grpc_slice& slice_in,
PercentEncodingType type);
Slice PercentEncodeSlice(Slice slice, PercentEncodingType type);
// Percent-decode a slice, permissively.
// If a % triplet can not be decoded, pass it through verbatim.
// This cannot fail.
grpc_slice PermissivePercentDecodeSlice(const grpc_slice& slice_in);
Slice PermissivePercentDecodeSlice(Slice slice_in);
} // namespace grpc_core

@ -162,10 +162,14 @@ struct CopyConstructors {
static Out FromCopiedString(std::string s) {
return Out(grpc_slice_from_cpp_string(std::move(s)));
}
static Out FromCopiedBuffer(const char* p, size_t len) {
return Out(UnmanagedMemorySlice(p, len));
}
template <typename Buffer>
static Out FromCopiedBuffer(const Buffer& buffer) {
return Out(UnmanagedMemorySlice(
reinterpret_cast<const char*>(buffer.data()), buffer.size()));
return FromCopiedBuffer(reinterpret_cast<const char*>(buffer.data()),
buffer.size());
}
};
@ -187,6 +191,10 @@ class StaticSlice : public slice_detail::BaseSlice {
return StaticSlice(grpc_slice_from_static_string(s));
}
static StaticSlice FromStaticString(absl::string_view s) {
return StaticSlice(ExternallyManagedSlice(s.data(), s.size()));
}
StaticSlice(const StaticSlice& other)
: slice_detail::BaseSlice(other.c_slice()) {}
StaticSlice& operator=(const StaticSlice& other) {
@ -221,6 +229,16 @@ class MutableSlice : public slice_detail::BaseSlice,
return *this;
}
static MutableSlice CreateUninitialized(size_t length) {
return MutableSlice(grpc_slice_malloc(length));
}
// Return a sub slice of this one. Leaves this slice in an indeterminate but
// valid state.
MutableSlice TakeSubSlice(size_t pos, size_t n) {
return MutableSlice(grpc_slice_sub_no_ref(TakeCSlice(), pos, pos + n));
}
// Iterator access to the underlying bytes
uint8_t* begin() { return mutable_data(); }
uint8_t* end() { return mutable_data() + size(); }
@ -235,10 +253,7 @@ class Slice : public slice_detail::BaseSlice,
Slice() = default;
~Slice() { grpc_slice_unref_internal(c_slice()); }
explicit Slice(const grpc_slice& slice) : slice_detail::BaseSlice(slice) {}
template <class SliceType>
explicit Slice(absl::enable_if_t<
std::is_base_of<slice_detail::BaseSlice, SliceType>::value,
SliceType>&& other)
explicit Slice(slice_detail::BaseSlice&& other)
: slice_detail::BaseSlice(other.TakeCSlice()) {}
Slice(const Slice&) = delete;
@ -300,6 +315,12 @@ class Slice : public slice_detail::BaseSlice,
return MutableSlice(grpc_slice_copy(c_slice()));
}
// Return a sub slice of this one. Leaves this slice in an indeterminate but
// valid state.
Slice TakeSubSlice(size_t pos, size_t n) {
return Slice(grpc_slice_sub_no_ref(TakeCSlice(), pos, pos + n));
}
Slice Ref() const { return Slice(grpc_slice_ref_internal(c_slice())); }
Slice Copy() const { return Slice(grpc_slice_copy(c_slice())); }

@ -32,154 +32,144 @@ namespace grpc_core {
const uint8_t g_static_metadata_bytes[] = {
58, 112, 97, 116, 104, 58, 109, 101, 116, 104, 111, 100, 58, 115, 116,
97, 116, 117, 115, 58, 97, 117, 116, 104, 111, 114, 105, 116, 121, 58,
115, 99, 104, 101, 109, 101, 103, 114, 112, 99, 45, 109, 101, 115, 115,
97, 103, 101, 103, 114, 112, 99, 45, 115, 116, 97, 116, 117, 115, 103,
114, 112, 99, 45, 112, 97, 121, 108, 111, 97, 100, 45, 98, 105, 110,
103, 114, 112, 99, 45, 101, 110, 99, 111, 100, 105, 110, 103, 103, 114,
112, 99, 45, 97, 99, 99, 101, 112, 116, 45, 101, 110, 99, 111, 100,
105, 110, 103, 103, 114, 112, 99, 45, 115, 101, 114, 118, 101, 114, 45,
115, 116, 97, 116, 115, 45, 98, 105, 110, 103, 114, 112, 99, 45, 116,
97, 103, 115, 45, 98, 105, 110, 103, 114, 112, 99, 45, 116, 114, 97,
99, 101, 45, 98, 105, 110, 99, 111, 110, 116, 101, 110, 116, 45, 116,
121, 112, 101, 99, 111, 110, 116, 101, 110, 116, 45, 101, 110, 99, 111,
100, 105, 110, 103, 97, 99, 99, 101, 112, 116, 45, 101, 110, 99, 111,
100, 105, 110, 103, 103, 114, 112, 99, 45, 105, 110, 116, 101, 114, 110,
97, 108, 45, 101, 110, 99, 111, 100, 105, 110, 103, 45, 114, 101, 113,
117, 101, 115, 116, 104, 111, 115, 116, 103, 114, 112, 99, 45, 112, 114,
101, 118, 105, 111, 117, 115, 45, 114, 112, 99, 45, 97, 116, 116, 101,
109, 112, 116, 115, 103, 114, 112, 99, 45, 114, 101, 116, 114, 121, 45,
112, 117, 115, 104, 98, 97, 99, 107, 45, 109, 115, 120, 45, 101, 110,
100, 112, 111, 105, 110, 116, 45, 108, 111, 97, 100, 45, 109, 101, 116,
114, 105, 99, 115, 45, 98, 105, 110, 103, 114, 112, 99, 45, 116, 105,
109, 101, 111, 117, 116, 117, 115, 101, 114, 45, 97, 103, 101, 110, 116,
49, 50, 51, 52, 47, 103, 114, 112, 99, 46, 108, 98, 46, 118, 49,
46, 76, 111, 97, 100, 66, 97, 108, 97, 110, 99, 101, 114, 47, 66,
97, 108, 97, 110, 99, 101, 76, 111, 97, 100, 47, 101, 110, 118, 111,
121, 46, 115, 101, 114, 118, 105, 99, 101, 46, 108, 111, 97, 100, 95,
115, 116, 97, 116, 115, 46, 118, 50, 46, 76, 111, 97, 100, 82, 101,
112, 111, 114, 116, 105, 110, 103, 83, 101, 114, 118, 105, 99, 101, 47,
83, 116, 114, 101, 97, 109, 76, 111, 97, 100, 83, 116, 97, 116, 115,
47, 101, 110, 118, 111, 121, 46, 115, 101, 114, 118, 105, 99, 101, 46,
108, 111, 97, 100, 95, 115, 116, 97, 116, 115, 46, 118, 51, 46, 76,
111, 97, 100, 82, 101, 112, 111, 114, 116, 105, 110, 103, 83, 101, 114,
118, 105, 99, 101, 47, 83, 116, 114, 101, 97, 109, 76, 111, 97, 100,
83, 116, 97, 116, 115, 47, 103, 114, 112, 99, 46, 104, 101, 97, 108,
116, 104, 46, 118, 49, 46, 72, 101, 97, 108, 116, 104, 47, 87, 97,
116, 99, 104, 47, 101, 110, 118, 111, 121, 46, 115, 101, 114, 118, 105,
99, 101, 46, 100, 105, 115, 99, 111, 118, 101, 114, 121, 46, 118, 50,
46, 65, 103, 103, 114, 101, 103, 97, 116, 101, 100, 68, 105, 115, 99,
111, 118, 101, 114, 121, 83, 101, 114, 118, 105, 99, 101, 47, 83, 116,
114, 101, 97, 109, 65, 103, 103, 114, 101, 103, 97, 116, 101, 100, 82,
101, 115, 111, 117, 114, 99, 101, 115, 47, 101, 110, 118, 111, 121, 46,
115, 101, 114, 118, 105, 99, 101, 46, 100, 105, 115, 99, 111, 118, 101,
114, 121, 46, 118, 51, 46, 65, 103, 103, 114, 101, 103, 97, 116, 101,
100, 68, 105, 115, 99, 111, 118, 101, 114, 121, 83, 101, 114, 118, 105,
99, 101, 47, 83, 116, 114, 101, 97, 109, 65, 103, 103, 114, 101, 103,
97, 116, 101, 100, 82, 101, 115, 111, 117, 114, 99, 101, 115, 100, 101,
102, 108, 97, 116, 101, 103, 122, 105, 112, 115, 116, 114, 101, 97, 109,
47, 103, 122, 105, 112, 116, 101, 116, 114, 97, 105, 108, 101, 114, 115,
71, 69, 84, 80, 79, 83, 84, 47, 47, 105, 110, 100, 101, 120, 46,
104, 116, 109, 108, 104, 116, 116, 112, 104, 116, 116, 112, 115, 50, 48,
48, 50, 48, 52, 50, 48, 54, 51, 48, 52, 52, 48, 48, 52, 48,
52, 53, 48, 48, 97, 99, 99, 101, 112, 116, 45, 99, 104, 97, 114,
115, 101, 116, 103, 122, 105, 112, 44, 32, 100, 101, 102, 108, 97, 116,
101, 97, 99, 99, 101, 112, 116, 45, 108, 97, 110, 103, 117, 97, 103,
101, 97, 99, 99, 101, 112, 116, 45, 114, 97, 110, 103, 101, 115, 97,
99, 99, 101, 112, 116, 97, 99, 99, 101, 115, 115, 45, 99, 111, 110,
116, 114, 111, 108, 45, 97, 108, 108, 111, 119, 45, 111, 114, 105, 103,
105, 110, 97, 103, 101, 97, 108, 108, 111, 119, 97, 117, 116, 104, 111,
114, 105, 122, 97, 116, 105, 111, 110, 99, 97, 99, 104, 101, 45, 99,
111, 110, 116, 114, 111, 108, 99, 111, 110, 116, 101, 110, 116, 45, 100,
105, 115, 112, 111, 115, 105, 116, 105, 111, 110, 99, 111, 110, 116, 101,
110, 116, 45, 108, 97, 110, 103, 117, 97, 103, 101, 99, 111, 110, 116,
101, 110, 116, 45, 108, 101, 110, 103, 116, 104, 99, 111, 110, 116, 101,
110, 116, 45, 108, 111, 99, 97, 116, 105, 111, 110, 99, 111, 110, 116,
101, 110, 116, 45, 114, 97, 110, 103, 101, 99, 111, 111, 107, 105, 101,
100, 97, 116, 101, 101, 116, 97, 103, 101, 120, 112, 101, 99, 116, 101,
120, 112, 105, 114, 101, 115, 102, 114, 111, 109, 105, 102, 45, 109, 97,
116, 99, 104, 105, 102, 45, 109, 111, 100, 105, 102, 105, 101, 100, 45,
115, 105, 110, 99, 101, 105, 102, 45, 110, 111, 110, 101, 45, 109, 97,
116, 99, 104, 105, 102, 45, 114, 97, 110, 103, 101, 105, 102, 45, 117,
110, 109, 111, 100, 105, 102, 105, 101, 100, 45, 115, 105, 110, 99, 101,
108, 97, 115, 116, 45, 109, 111, 100, 105, 102, 105, 101, 100, 108, 105,
110, 107, 108, 111, 99, 97, 116, 105, 111, 110, 109, 97, 120, 45, 102,
111, 114, 119, 97, 114, 100, 115, 112, 114, 111, 120, 121, 45, 97, 117,
116, 104, 101, 110, 116, 105, 99, 97, 116, 101, 112, 114, 111, 120, 121,
45, 97, 117, 116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 114,
97, 110, 103, 101, 114, 101, 102, 101, 114, 101, 114, 114, 101, 102, 114,
101, 115, 104, 114, 101, 116, 114, 121, 45, 97, 102, 116, 101, 114, 115,
101, 114, 118, 101, 114, 115, 101, 116, 45, 99, 111, 111, 107, 105, 101,
115, 116, 114, 105, 99, 116, 45, 116, 114, 97, 110, 115, 112, 111, 114,
116, 45, 115, 101, 99, 117, 114, 105, 116, 121, 116, 114, 97, 110, 115,
102, 101, 114, 45, 101, 110, 99, 111, 100, 105, 110, 103, 118, 97, 114,
121, 118, 105, 97, 119, 119, 119, 45, 97, 117, 116, 104, 101, 110, 116,
105, 99, 97, 116, 101, 48, 105, 100, 101, 110, 116, 105, 116, 121, 97,
112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 103, 114, 112, 99,
103, 114, 112, 99, 80, 85, 84, 108, 98, 45, 99, 111, 115, 116, 45,
98, 105, 110, 105, 100, 101, 110, 116, 105, 116, 121, 44, 100, 101, 102,
108, 97, 116, 101, 105, 100, 101, 110, 116, 105, 116, 121, 44, 103, 122,
105, 112, 100, 101, 102, 108, 97, 116, 101, 44, 103, 122, 105, 112, 105,
100, 101, 110, 116, 105, 116, 121, 44, 100, 101, 102, 108, 97, 116, 101,
44, 103, 122, 105, 112};
115, 99, 104, 101, 109, 101, 103, 114, 112, 99, 45, 115, 116, 97, 116,
117, 115, 103, 114, 112, 99, 45, 101, 110, 99, 111, 100, 105, 110, 103,
103, 114, 112, 99, 45, 97, 99, 99, 101, 112, 116, 45, 101, 110, 99,
111, 100, 105, 110, 103, 99, 111, 110, 116, 101, 110, 116, 45, 116, 121,
112, 101, 99, 111, 110, 116, 101, 110, 116, 45, 101, 110, 99, 111, 100,
105, 110, 103, 97, 99, 99, 101, 112, 116, 45, 101, 110, 99, 111, 100,
105, 110, 103, 103, 114, 112, 99, 45, 105, 110, 116, 101, 114, 110, 97,
108, 45, 101, 110, 99, 111, 100, 105, 110, 103, 45, 114, 101, 113, 117,
101, 115, 116, 103, 114, 112, 99, 45, 112, 114, 101, 118, 105, 111, 117,
115, 45, 114, 112, 99, 45, 97, 116, 116, 101, 109, 112, 116, 115, 103,
114, 112, 99, 45, 114, 101, 116, 114, 121, 45, 112, 117, 115, 104, 98,
97, 99, 107, 45, 109, 115, 103, 114, 112, 99, 45, 116, 105, 109, 101,
111, 117, 116, 49, 50, 51, 52, 47, 103, 114, 112, 99, 46, 108, 98,
46, 118, 49, 46, 76, 111, 97, 100, 66, 97, 108, 97, 110, 99, 101,
114, 47, 66, 97, 108, 97, 110, 99, 101, 76, 111, 97, 100, 47, 101,
110, 118, 111, 121, 46, 115, 101, 114, 118, 105, 99, 101, 46, 108, 111,
97, 100, 95, 115, 116, 97, 116, 115, 46, 118, 50, 46, 76, 111, 97,
100, 82, 101, 112, 111, 114, 116, 105, 110, 103, 83, 101, 114, 118, 105,
99, 101, 47, 83, 116, 114, 101, 97, 109, 76, 111, 97, 100, 83, 116,
97, 116, 115, 47, 101, 110, 118, 111, 121, 46, 115, 101, 114, 118, 105,
99, 101, 46, 108, 111, 97, 100, 95, 115, 116, 97, 116, 115, 46, 118,
51, 46, 76, 111, 97, 100, 82, 101, 112, 111, 114, 116, 105, 110, 103,
83, 101, 114, 118, 105, 99, 101, 47, 83, 116, 114, 101, 97, 109, 76,
111, 97, 100, 83, 116, 97, 116, 115, 47, 103, 114, 112, 99, 46, 104,
101, 97, 108, 116, 104, 46, 118, 49, 46, 72, 101, 97, 108, 116, 104,
47, 87, 97, 116, 99, 104, 47, 101, 110, 118, 111, 121, 46, 115, 101,
114, 118, 105, 99, 101, 46, 100, 105, 115, 99, 111, 118, 101, 114, 121,
46, 118, 50, 46, 65, 103, 103, 114, 101, 103, 97, 116, 101, 100, 68,
105, 115, 99, 111, 118, 101, 114, 121, 83, 101, 114, 118, 105, 99, 101,
47, 83, 116, 114, 101, 97, 109, 65, 103, 103, 114, 101, 103, 97, 116,
101, 100, 82, 101, 115, 111, 117, 114, 99, 101, 115, 47, 101, 110, 118,
111, 121, 46, 115, 101, 114, 118, 105, 99, 101, 46, 100, 105, 115, 99,
111, 118, 101, 114, 121, 46, 118, 51, 46, 65, 103, 103, 114, 101, 103,
97, 116, 101, 100, 68, 105, 115, 99, 111, 118, 101, 114, 121, 83, 101,
114, 118, 105, 99, 101, 47, 83, 116, 114, 101, 97, 109, 65, 103, 103,
114, 101, 103, 97, 116, 101, 100, 82, 101, 115, 111, 117, 114, 99, 101,
115, 100, 101, 102, 108, 97, 116, 101, 103, 122, 105, 112, 115, 116, 114,
101, 97, 109, 47, 103, 122, 105, 112, 116, 101, 116, 114, 97, 105, 108,
101, 114, 115, 71, 69, 84, 80, 79, 83, 84, 47, 47, 105, 110, 100,
101, 120, 46, 104, 116, 109, 108, 104, 116, 116, 112, 104, 116, 116, 112,
115, 50, 48, 48, 50, 48, 52, 50, 48, 54, 51, 48, 52, 52, 48,
48, 52, 48, 52, 53, 48, 48, 97, 99, 99, 101, 112, 116, 45, 99,
104, 97, 114, 115, 101, 116, 103, 122, 105, 112, 44, 32, 100, 101, 102,
108, 97, 116, 101, 97, 99, 99, 101, 112, 116, 45, 108, 97, 110, 103,
117, 97, 103, 101, 97, 99, 99, 101, 112, 116, 45, 114, 97, 110, 103,
101, 115, 97, 99, 99, 101, 112, 116, 97, 99, 99, 101, 115, 115, 45,
99, 111, 110, 116, 114, 111, 108, 45, 97, 108, 108, 111, 119, 45, 111,
114, 105, 103, 105, 110, 97, 103, 101, 97, 108, 108, 111, 119, 97, 117,
116, 104, 111, 114, 105, 122, 97, 116, 105, 111, 110, 99, 97, 99, 104,
101, 45, 99, 111, 110, 116, 114, 111, 108, 99, 111, 110, 116, 101, 110,
116, 45, 100, 105, 115, 112, 111, 115, 105, 116, 105, 111, 110, 99, 111,
110, 116, 101, 110, 116, 45, 108, 97, 110, 103, 117, 97, 103, 101, 99,
111, 110, 116, 101, 110, 116, 45, 108, 101, 110, 103, 116, 104, 99, 111,
110, 116, 101, 110, 116, 45, 108, 111, 99, 97, 116, 105, 111, 110, 99,
111, 110, 116, 101, 110, 116, 45, 114, 97, 110, 103, 101, 99, 111, 111,
107, 105, 101, 100, 97, 116, 101, 101, 116, 97, 103, 101, 120, 112, 101,
99, 116, 101, 120, 112, 105, 114, 101, 115, 102, 114, 111, 109, 104, 111,
115, 116, 105, 102, 45, 109, 97, 116, 99, 104, 105, 102, 45, 109, 111,
100, 105, 102, 105, 101, 100, 45, 115, 105, 110, 99, 101, 105, 102, 45,
110, 111, 110, 101, 45, 109, 97, 116, 99, 104, 105, 102, 45, 114, 97,
110, 103, 101, 105, 102, 45, 117, 110, 109, 111, 100, 105, 102, 105, 101,
100, 45, 115, 105, 110, 99, 101, 108, 97, 115, 116, 45, 109, 111, 100,
105, 102, 105, 101, 100, 108, 105, 110, 107, 108, 111, 99, 97, 116, 105,
111, 110, 109, 97, 120, 45, 102, 111, 114, 119, 97, 114, 100, 115, 112,
114, 111, 120, 121, 45, 97, 117, 116, 104, 101, 110, 116, 105, 99, 97,
116, 101, 112, 114, 111, 120, 121, 45, 97, 117, 116, 104, 111, 114, 105,
122, 97, 116, 105, 111, 110, 114, 97, 110, 103, 101, 114, 101, 102, 101,
114, 101, 114, 114, 101, 102, 114, 101, 115, 104, 114, 101, 116, 114, 121,
45, 97, 102, 116, 101, 114, 115, 101, 114, 118, 101, 114, 115, 101, 116,
45, 99, 111, 111, 107, 105, 101, 115, 116, 114, 105, 99, 116, 45, 116,
114, 97, 110, 115, 112, 111, 114, 116, 45, 115, 101, 99, 117, 114, 105,
116, 121, 116, 114, 97, 110, 115, 102, 101, 114, 45, 101, 110, 99, 111,
100, 105, 110, 103, 117, 115, 101, 114, 45, 97, 103, 101, 110, 116, 118,
97, 114, 121, 118, 105, 97, 119, 119, 119, 45, 97, 117, 116, 104, 101,
110, 116, 105, 99, 97, 116, 101, 48, 105, 100, 101, 110, 116, 105, 116,
121, 97, 112, 112, 108, 105, 99, 97, 116, 105, 111, 110, 47, 103, 114,
112, 99, 103, 114, 112, 99, 80, 85, 84, 108, 98, 45, 99, 111, 115,
116, 45, 98, 105, 110, 105, 100, 101, 110, 116, 105, 116, 121, 44, 100,
101, 102, 108, 97, 116, 101, 105, 100, 101, 110, 116, 105, 116, 121, 44,
103, 122, 105, 112, 100, 101, 102, 108, 97, 116, 101, 44, 103, 122, 105,
112, 105, 100, 101, 110, 116, 105, 116, 121, 44, 100, 101, 102, 108, 97,
116, 101, 44, 103, 122, 105, 112};
grpc_slice_refcount StaticSliceRefcount::kStaticSubRefcount;
StaticSliceRefcount g_static_metadata_slice_refcounts[GRPC_STATIC_MDSTR_COUNT] =
{
StaticSliceRefcount(0), StaticSliceRefcount(1),
StaticSliceRefcount(2), StaticSliceRefcount(3),
StaticSliceRefcount(4), StaticSliceRefcount(5),
StaticSliceRefcount(6), StaticSliceRefcount(7),
StaticSliceRefcount(8), StaticSliceRefcount(9),
StaticSliceRefcount(10), StaticSliceRefcount(11),
StaticSliceRefcount(12), StaticSliceRefcount(13),
StaticSliceRefcount(14), StaticSliceRefcount(15),
StaticSliceRefcount(16), StaticSliceRefcount(17),
StaticSliceRefcount(18), StaticSliceRefcount(19),
StaticSliceRefcount(20), StaticSliceRefcount(21),
StaticSliceRefcount(22), StaticSliceRefcount(23),
StaticSliceRefcount(24), StaticSliceRefcount(25),
StaticSliceRefcount(26), StaticSliceRefcount(27),
StaticSliceRefcount(28), StaticSliceRefcount(29),
StaticSliceRefcount(30), StaticSliceRefcount(31),
StaticSliceRefcount(32), StaticSliceRefcount(33),
StaticSliceRefcount(34), StaticSliceRefcount(35),
StaticSliceRefcount(36), StaticSliceRefcount(37),
StaticSliceRefcount(38), StaticSliceRefcount(39),
StaticSliceRefcount(40), StaticSliceRefcount(41),
StaticSliceRefcount(42), StaticSliceRefcount(43),
StaticSliceRefcount(44), StaticSliceRefcount(45),
StaticSliceRefcount(46), StaticSliceRefcount(47),
StaticSliceRefcount(48), StaticSliceRefcount(49),
StaticSliceRefcount(50), StaticSliceRefcount(51),
StaticSliceRefcount(52), StaticSliceRefcount(53),
StaticSliceRefcount(54), StaticSliceRefcount(55),
StaticSliceRefcount(56), StaticSliceRefcount(57),
StaticSliceRefcount(58), StaticSliceRefcount(59),
StaticSliceRefcount(60), StaticSliceRefcount(61),
StaticSliceRefcount(62), StaticSliceRefcount(63),
StaticSliceRefcount(64), StaticSliceRefcount(65),
StaticSliceRefcount(66), StaticSliceRefcount(67),
StaticSliceRefcount(68), StaticSliceRefcount(69),
StaticSliceRefcount(70), StaticSliceRefcount(71),
StaticSliceRefcount(72), StaticSliceRefcount(73),
StaticSliceRefcount(74), StaticSliceRefcount(75),
StaticSliceRefcount(76), StaticSliceRefcount(77),
StaticSliceRefcount(78), StaticSliceRefcount(79),
StaticSliceRefcount(80), StaticSliceRefcount(81),
StaticSliceRefcount(82), StaticSliceRefcount(83),
StaticSliceRefcount(84), StaticSliceRefcount(85),
StaticSliceRefcount(86), StaticSliceRefcount(87),
StaticSliceRefcount(88), StaticSliceRefcount(89),
StaticSliceRefcount(90), StaticSliceRefcount(91),
StaticSliceRefcount(92), StaticSliceRefcount(93),
StaticSliceRefcount(94), StaticSliceRefcount(95),
StaticSliceRefcount(96), StaticSliceRefcount(97),
StaticSliceRefcount(98), StaticSliceRefcount(99),
StaticSliceRefcount(100), StaticSliceRefcount(101),
StaticSliceRefcount(102), StaticSliceRefcount(103),
StaticSliceRefcount(104),
StaticSliceRefcount(0), StaticSliceRefcount(1),
StaticSliceRefcount(2), StaticSliceRefcount(3),
StaticSliceRefcount(4), StaticSliceRefcount(5),
StaticSliceRefcount(6), StaticSliceRefcount(7),
StaticSliceRefcount(8), StaticSliceRefcount(9),
StaticSliceRefcount(10), StaticSliceRefcount(11),
StaticSliceRefcount(12), StaticSliceRefcount(13),
StaticSliceRefcount(14), StaticSliceRefcount(15),
StaticSliceRefcount(16), StaticSliceRefcount(17),
StaticSliceRefcount(18), StaticSliceRefcount(19),
StaticSliceRefcount(20), StaticSliceRefcount(21),
StaticSliceRefcount(22), StaticSliceRefcount(23),
StaticSliceRefcount(24), StaticSliceRefcount(25),
StaticSliceRefcount(26), StaticSliceRefcount(27),
StaticSliceRefcount(28), StaticSliceRefcount(29),
StaticSliceRefcount(30), StaticSliceRefcount(31),
StaticSliceRefcount(32), StaticSliceRefcount(33),
StaticSliceRefcount(34), StaticSliceRefcount(35),
StaticSliceRefcount(36), StaticSliceRefcount(37),
StaticSliceRefcount(38), StaticSliceRefcount(39),
StaticSliceRefcount(40), StaticSliceRefcount(41),
StaticSliceRefcount(42), StaticSliceRefcount(43),
StaticSliceRefcount(44), StaticSliceRefcount(45),
StaticSliceRefcount(46), StaticSliceRefcount(47),
StaticSliceRefcount(48), StaticSliceRefcount(49),
StaticSliceRefcount(50), StaticSliceRefcount(51),
StaticSliceRefcount(52), StaticSliceRefcount(53),
StaticSliceRefcount(54), StaticSliceRefcount(55),
StaticSliceRefcount(56), StaticSliceRefcount(57),
StaticSliceRefcount(58), StaticSliceRefcount(59),
StaticSliceRefcount(60), StaticSliceRefcount(61),
StaticSliceRefcount(62), StaticSliceRefcount(63),
StaticSliceRefcount(64), StaticSliceRefcount(65),
StaticSliceRefcount(66), StaticSliceRefcount(67),
StaticSliceRefcount(68), StaticSliceRefcount(69),
StaticSliceRefcount(70), StaticSliceRefcount(71),
StaticSliceRefcount(72), StaticSliceRefcount(73),
StaticSliceRefcount(74), StaticSliceRefcount(75),
StaticSliceRefcount(76), StaticSliceRefcount(77),
StaticSliceRefcount(78), StaticSliceRefcount(79),
StaticSliceRefcount(80), StaticSliceRefcount(81),
StaticSliceRefcount(82), StaticSliceRefcount(83),
StaticSliceRefcount(84), StaticSliceRefcount(85),
StaticSliceRefcount(86), StaticSliceRefcount(87),
StaticSliceRefcount(88), StaticSliceRefcount(89),
StaticSliceRefcount(90), StaticSliceRefcount(91),
StaticSliceRefcount(92), StaticSliceRefcount(93),
StaticSliceRefcount(94), StaticSliceRefcount(95),
StaticSliceRefcount(96), StaticSliceRefcount(97),
StaticSliceRefcount(98),
};
const StaticMetadataSlice
@ -195,205 +185,193 @@ const StaticMetadataSlice
g_static_metadata_bytes + 19),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[4].base, 7,
g_static_metadata_bytes + 29),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[5].base, 12,
StaticMetadataSlice(&g_static_metadata_slice_refcounts[5].base, 11,
g_static_metadata_bytes + 36),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[6].base, 11,
g_static_metadata_bytes + 48),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[7].base, 16,
g_static_metadata_bytes + 59),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[8].base, 13,
g_static_metadata_bytes + 75),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 20,
g_static_metadata_bytes + 88),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[10].base, 21,
StaticMetadataSlice(&g_static_metadata_slice_refcounts[6].base, 13,
g_static_metadata_bytes + 47),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[7].base, 20,
g_static_metadata_bytes + 60),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[8].base, 12,
g_static_metadata_bytes + 80),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 16,
g_static_metadata_bytes + 92),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[10].base, 15,
g_static_metadata_bytes + 108),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[11].base, 13,
g_static_metadata_bytes + 129),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[12].base, 14,
g_static_metadata_bytes + 142),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[13].base, 12,
g_static_metadata_bytes + 156),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[14].base, 16,
g_static_metadata_bytes + 168),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[15].base, 15,
g_static_metadata_bytes + 184),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[16].base, 30,
g_static_metadata_bytes + 199),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[17].base, 4,
g_static_metadata_bytes + 229),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[18].base, 26,
g_static_metadata_bytes + 233),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 22,
g_static_metadata_bytes + 259),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[20].base, 27,
g_static_metadata_bytes + 281),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[21].base, 12,
g_static_metadata_bytes + 308),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[22].base, 10,
g_static_metadata_bytes + 320),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[23].base, 1,
g_static_metadata_bytes + 330),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[24].base, 1,
g_static_metadata_bytes + 331),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[25].base, 1,
g_static_metadata_bytes + 332),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[26].base, 1,
g_static_metadata_bytes + 333),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 36,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[29].base, 65,
g_static_metadata_bytes + 370),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[30].base, 65,
g_static_metadata_bytes + 435),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[31].base, 28,
g_static_metadata_bytes + 500),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[32].base, 80,
g_static_metadata_bytes + 528),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[33].base, 80,
g_static_metadata_bytes + 608),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[34].base, 7,
g_static_metadata_bytes + 688),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[11].base, 30,
g_static_metadata_bytes + 123),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[12].base, 26,
g_static_metadata_bytes + 153),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[13].base, 22,
g_static_metadata_bytes + 179),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[14].base, 12,
g_static_metadata_bytes + 201),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[15].base, 1,
g_static_metadata_bytes + 213),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[16].base, 1,
g_static_metadata_bytes + 214),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[17].base, 1,
g_static_metadata_bytes + 215),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[18].base, 1,
g_static_metadata_bytes + 216),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[20].base, 36,
g_static_metadata_bytes + 217),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[21].base, 65,
g_static_metadata_bytes + 253),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[22].base, 65,
g_static_metadata_bytes + 318),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[23].base, 28,
g_static_metadata_bytes + 383),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[24].base, 80,
g_static_metadata_bytes + 411),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[25].base, 80,
g_static_metadata_bytes + 491),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[26].base, 7,
g_static_metadata_bytes + 571),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 4,
g_static_metadata_bytes + 578),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[28].base, 11,
g_static_metadata_bytes + 582),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[29].base, 2,
g_static_metadata_bytes + 593),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[30].base, 8,
g_static_metadata_bytes + 595),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[31].base, 3,
g_static_metadata_bytes + 603),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[32].base, 4,
g_static_metadata_bytes + 606),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[33].base, 1,
g_static_metadata_bytes + 610),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[34].base, 11,
g_static_metadata_bytes + 611),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[35].base, 4,
g_static_metadata_bytes + 695),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[36].base, 11,
g_static_metadata_bytes + 699),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[37].base, 2,
g_static_metadata_bytes + 710),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[38].base, 8,
g_static_metadata_bytes + 712),
g_static_metadata_bytes + 622),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[36].base, 5,
g_static_metadata_bytes + 626),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[37].base, 3,
g_static_metadata_bytes + 631),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[38].base, 3,
g_static_metadata_bytes + 634),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[39].base, 3,
g_static_metadata_bytes + 720),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[40].base, 4,
g_static_metadata_bytes + 723),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[41].base, 1,
g_static_metadata_bytes + 727),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[42].base, 11,
g_static_metadata_bytes + 728),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[43].base, 4,
g_static_metadata_bytes + 739),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[44].base, 5,
g_static_metadata_bytes + 637),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[40].base, 3,
g_static_metadata_bytes + 640),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[41].base, 3,
g_static_metadata_bytes + 643),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[42].base, 3,
g_static_metadata_bytes + 646),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[43].base, 3,
g_static_metadata_bytes + 649),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[44].base, 14,
g_static_metadata_bytes + 652),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[45].base, 13,
g_static_metadata_bytes + 666),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[46].base, 15,
g_static_metadata_bytes + 679),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[47].base, 13,
g_static_metadata_bytes + 694),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[48].base, 6,
g_static_metadata_bytes + 707),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[49].base, 27,
g_static_metadata_bytes + 713),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[50].base, 3,
g_static_metadata_bytes + 740),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[51].base, 5,
g_static_metadata_bytes + 743),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[45].base, 3,
StaticMetadataSlice(&g_static_metadata_slice_refcounts[52].base, 13,
g_static_metadata_bytes + 748),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[46].base, 3,
g_static_metadata_bytes + 751),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[47].base, 3,
g_static_metadata_bytes + 754),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[48].base, 3,
g_static_metadata_bytes + 757),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[49].base, 3,
g_static_metadata_bytes + 760),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[50].base, 3,
g_static_metadata_bytes + 763),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[51].base, 3,
g_static_metadata_bytes + 766),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[52].base, 14,
g_static_metadata_bytes + 769),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[53].base, 13,
g_static_metadata_bytes + 783),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[54].base, 15,
g_static_metadata_bytes + 796),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[55].base, 13,
g_static_metadata_bytes + 811),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[56].base, 6,
g_static_metadata_bytes + 824),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[57].base, 27,
g_static_metadata_bytes + 830),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[58].base, 3,
g_static_metadata_bytes + 857),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[59].base, 5,
g_static_metadata_bytes + 860),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[60].base, 13,
g_static_metadata_bytes + 865),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[61].base, 13,
g_static_metadata_bytes + 878),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[62].base, 19,
g_static_metadata_bytes + 891),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[63].base, 16,
g_static_metadata_bytes + 910),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[64].base, 14,
g_static_metadata_bytes + 926),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[65].base, 16,
g_static_metadata_bytes + 940),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[66].base, 13,
g_static_metadata_bytes + 956),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[67].base, 6,
g_static_metadata_bytes + 969),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[68].base, 4,
g_static_metadata_bytes + 975),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[69].base, 4,
g_static_metadata_bytes + 979),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[70].base, 6,
g_static_metadata_bytes + 983),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[71].base, 7,
g_static_metadata_bytes + 989),
g_static_metadata_bytes + 761),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[54].base, 19,
g_static_metadata_bytes + 774),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[55].base, 16,
g_static_metadata_bytes + 793),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[56].base, 14,
g_static_metadata_bytes + 809),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[57].base, 16,
g_static_metadata_bytes + 823),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[58].base, 13,
g_static_metadata_bytes + 839),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[59].base, 6,
g_static_metadata_bytes + 852),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[60].base, 4,
g_static_metadata_bytes + 858),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[61].base, 4,
g_static_metadata_bytes + 862),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[62].base, 6,
g_static_metadata_bytes + 866),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[63].base, 7,
g_static_metadata_bytes + 872),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[64].base, 4,
g_static_metadata_bytes + 879),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[65].base, 4,
g_static_metadata_bytes + 883),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[66].base, 8,
g_static_metadata_bytes + 887),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[67].base, 17,
g_static_metadata_bytes + 895),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[68].base, 13,
g_static_metadata_bytes + 912),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[69].base, 8,
g_static_metadata_bytes + 925),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[70].base, 19,
g_static_metadata_bytes + 933),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[71].base, 13,
g_static_metadata_bytes + 952),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[72].base, 4,
g_static_metadata_bytes + 996),
g_static_metadata_bytes + 965),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[73].base, 8,
g_static_metadata_bytes + 1000),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[74].base, 17,
g_static_metadata_bytes + 1008),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[75].base, 13,
g_static_metadata_bytes + 1025),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[76].base, 8,
g_static_metadata_bytes + 969),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[74].base, 12,
g_static_metadata_bytes + 977),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[75].base, 18,
g_static_metadata_bytes + 989),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[76].base, 19,
g_static_metadata_bytes + 1007),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[77].base, 5,
g_static_metadata_bytes + 1026),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[78].base, 7,
g_static_metadata_bytes + 1031),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[79].base, 7,
g_static_metadata_bytes + 1038),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[77].base, 19,
g_static_metadata_bytes + 1046),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[78].base, 13,
g_static_metadata_bytes + 1065),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[79].base, 4,
g_static_metadata_bytes + 1078),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[80].base, 8,
g_static_metadata_bytes + 1082),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[81].base, 12,
g_static_metadata_bytes + 1090),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[82].base, 18,
g_static_metadata_bytes + 1102),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[83].base, 19,
g_static_metadata_bytes + 1120),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[84].base, 5,
g_static_metadata_bytes + 1139),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[85].base, 7,
g_static_metadata_bytes + 1144),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[86].base, 7,
g_static_metadata_bytes + 1151),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[87].base, 11,
g_static_metadata_bytes + 1158),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[88].base, 6,
g_static_metadata_bytes + 1169),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[89].base, 10,
g_static_metadata_bytes + 1175),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[90].base, 25,
g_static_metadata_bytes + 1185),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[91].base, 17,
g_static_metadata_bytes + 1210),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[80].base, 11,
g_static_metadata_bytes + 1045),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[81].base, 6,
g_static_metadata_bytes + 1056),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[82].base, 10,
g_static_metadata_bytes + 1062),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[83].base, 25,
g_static_metadata_bytes + 1072),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[84].base, 17,
g_static_metadata_bytes + 1097),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[85].base, 10,
g_static_metadata_bytes + 1114),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[86].base, 4,
g_static_metadata_bytes + 1124),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[87].base, 3,
g_static_metadata_bytes + 1128),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[88].base, 16,
g_static_metadata_bytes + 1131),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[89].base, 1,
g_static_metadata_bytes + 1147),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[90].base, 8,
g_static_metadata_bytes + 1148),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[91].base, 16,
g_static_metadata_bytes + 1156),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[92].base, 4,
g_static_metadata_bytes + 1227),
g_static_metadata_bytes + 1172),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[93].base, 3,
g_static_metadata_bytes + 1176),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[94].base, 11,
g_static_metadata_bytes + 1179),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[95].base, 16,
g_static_metadata_bytes + 1190),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[96].base, 13,
g_static_metadata_bytes + 1206),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[97].base, 12,
g_static_metadata_bytes + 1219),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[98].base, 21,
g_static_metadata_bytes + 1231),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[94].base, 16,
g_static_metadata_bytes + 1234),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[95].base, 1,
g_static_metadata_bytes + 1250),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[96].base, 8,
g_static_metadata_bytes + 1251),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[97].base, 16,
g_static_metadata_bytes + 1259),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[98].base, 4,
g_static_metadata_bytes + 1275),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[99].base, 3,
g_static_metadata_bytes + 1279),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[100].base, 11,
g_static_metadata_bytes + 1282),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[101].base, 16,
g_static_metadata_bytes + 1293),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[102].base, 13,
g_static_metadata_bytes + 1309),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[103].base, 12,
g_static_metadata_bytes + 1322),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[104].base, 21,
g_static_metadata_bytes + 1334),
};
} // namespace grpc_core

@ -38,7 +38,7 @@
static_assert(
std::is_trivially_destructible<grpc_core::StaticMetadataSlice>::value,
"StaticMetadataSlice must be trivially destructible.");
#define GRPC_STATIC_MDSTR_COUNT 105
#define GRPC_STATIC_MDSTR_COUNT 99
/* ":path" */
#define GRPC_MDSTR_PATH (::grpc_core::g_static_metadata_slice_table[0])
/* ":method" */
@ -49,253 +49,236 @@ static_assert(
#define GRPC_MDSTR_AUTHORITY (::grpc_core::g_static_metadata_slice_table[3])
/* ":scheme" */
#define GRPC_MDSTR_SCHEME (::grpc_core::g_static_metadata_slice_table[4])
/* "grpc-message" */
#define GRPC_MDSTR_GRPC_MESSAGE (::grpc_core::g_static_metadata_slice_table[5])
/* "grpc-status" */
#define GRPC_MDSTR_GRPC_STATUS (::grpc_core::g_static_metadata_slice_table[6])
/* "grpc-payload-bin" */
#define GRPC_MDSTR_GRPC_PAYLOAD_BIN \
(::grpc_core::g_static_metadata_slice_table[7])
#define GRPC_MDSTR_GRPC_STATUS (::grpc_core::g_static_metadata_slice_table[5])
/* "grpc-encoding" */
#define GRPC_MDSTR_GRPC_ENCODING (::grpc_core::g_static_metadata_slice_table[8])
#define GRPC_MDSTR_GRPC_ENCODING (::grpc_core::g_static_metadata_slice_table[6])
/* "grpc-accept-encoding" */
#define GRPC_MDSTR_GRPC_ACCEPT_ENCODING \
(::grpc_core::g_static_metadata_slice_table[9])
/* "grpc-server-stats-bin" */
#define GRPC_MDSTR_GRPC_SERVER_STATS_BIN \
(::grpc_core::g_static_metadata_slice_table[10])
/* "grpc-tags-bin" */
#define GRPC_MDSTR_GRPC_TAGS_BIN \
(::grpc_core::g_static_metadata_slice_table[11])
/* "grpc-trace-bin" */
#define GRPC_MDSTR_GRPC_TRACE_BIN \
(::grpc_core::g_static_metadata_slice_table[12])
(::grpc_core::g_static_metadata_slice_table[7])
/* "content-type" */
#define GRPC_MDSTR_CONTENT_TYPE (::grpc_core::g_static_metadata_slice_table[13])
#define GRPC_MDSTR_CONTENT_TYPE (::grpc_core::g_static_metadata_slice_table[8])
/* "content-encoding" */
#define GRPC_MDSTR_CONTENT_ENCODING \
(::grpc_core::g_static_metadata_slice_table[14])
(::grpc_core::g_static_metadata_slice_table[9])
/* "accept-encoding" */
#define GRPC_MDSTR_ACCEPT_ENCODING \
(::grpc_core::g_static_metadata_slice_table[15])
(::grpc_core::g_static_metadata_slice_table[10])
/* "grpc-internal-encoding-request" */
#define GRPC_MDSTR_GRPC_INTERNAL_ENCODING_REQUEST \
(::grpc_core::g_static_metadata_slice_table[16])
/* "host" */
#define GRPC_MDSTR_HOST (::grpc_core::g_static_metadata_slice_table[17])
(::grpc_core::g_static_metadata_slice_table[11])
/* "grpc-previous-rpc-attempts" */
#define GRPC_MDSTR_GRPC_PREVIOUS_RPC_ATTEMPTS \
(::grpc_core::g_static_metadata_slice_table[18])
(::grpc_core::g_static_metadata_slice_table[12])
/* "grpc-retry-pushback-ms" */
#define GRPC_MDSTR_GRPC_RETRY_PUSHBACK_MS \
(::grpc_core::g_static_metadata_slice_table[19])
/* "x-endpoint-load-metrics-bin" */
#define GRPC_MDSTR_X_ENDPOINT_LOAD_METRICS_BIN \
(::grpc_core::g_static_metadata_slice_table[20])
(::grpc_core::g_static_metadata_slice_table[13])
/* "grpc-timeout" */
#define GRPC_MDSTR_GRPC_TIMEOUT (::grpc_core::g_static_metadata_slice_table[21])
/* "user-agent" */
#define GRPC_MDSTR_USER_AGENT (::grpc_core::g_static_metadata_slice_table[22])
#define GRPC_MDSTR_GRPC_TIMEOUT (::grpc_core::g_static_metadata_slice_table[14])
/* "1" */
#define GRPC_MDSTR_1 (::grpc_core::g_static_metadata_slice_table[23])
#define GRPC_MDSTR_1 (::grpc_core::g_static_metadata_slice_table[15])
/* "2" */
#define GRPC_MDSTR_2 (::grpc_core::g_static_metadata_slice_table[24])
#define GRPC_MDSTR_2 (::grpc_core::g_static_metadata_slice_table[16])
/* "3" */
#define GRPC_MDSTR_3 (::grpc_core::g_static_metadata_slice_table[25])
#define GRPC_MDSTR_3 (::grpc_core::g_static_metadata_slice_table[17])
/* "4" */
#define GRPC_MDSTR_4 (::grpc_core::g_static_metadata_slice_table[26])
#define GRPC_MDSTR_4 (::grpc_core::g_static_metadata_slice_table[18])
/* "" */
#define GRPC_MDSTR_EMPTY (::grpc_core::g_static_metadata_slice_table[27])
#define GRPC_MDSTR_EMPTY (::grpc_core::g_static_metadata_slice_table[19])
/* "/grpc.lb.v1.LoadBalancer/BalanceLoad" */
#define GRPC_MDSTR_SLASH_GRPC_DOT_LB_DOT_V1_DOT_LOADBALANCER_SLASH_BALANCELOAD \
(::grpc_core::g_static_metadata_slice_table[28])
(::grpc_core::g_static_metadata_slice_table[20])
/* "/envoy.service.load_stats.v2.LoadReportingService/StreamLoadStats" */
#define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_LOAD_STATS_DOT_V2_DOT_LOADREPORTINGSERVICE_SLASH_STREAMLOADSTATS \
(::grpc_core::g_static_metadata_slice_table[29])
(::grpc_core::g_static_metadata_slice_table[21])
/* "/envoy.service.load_stats.v3.LoadReportingService/StreamLoadStats" */
#define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_LOAD_STATS_DOT_V3_DOT_LOADREPORTINGSERVICE_SLASH_STREAMLOADSTATS \
(::grpc_core::g_static_metadata_slice_table[30])
(::grpc_core::g_static_metadata_slice_table[22])
/* "/grpc.health.v1.Health/Watch" */
#define GRPC_MDSTR_SLASH_GRPC_DOT_HEALTH_DOT_V1_DOT_HEALTH_SLASH_WATCH \
(::grpc_core::g_static_metadata_slice_table[31])
(::grpc_core::g_static_metadata_slice_table[23])
/* "/envoy.service.discovery.v2.AggregatedDiscoveryService/StreamAggregatedResources"
*/
#define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_DISCOVERY_DOT_V2_DOT_AGGREGATEDDISCOVERYSERVICE_SLASH_STREAMAGGREGATEDRESOURCES \
(::grpc_core::g_static_metadata_slice_table[32])
(::grpc_core::g_static_metadata_slice_table[24])
/* "/envoy.service.discovery.v3.AggregatedDiscoveryService/StreamAggregatedResources"
*/
#define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_DISCOVERY_DOT_V3_DOT_AGGREGATEDDISCOVERYSERVICE_SLASH_STREAMAGGREGATEDRESOURCES \
(::grpc_core::g_static_metadata_slice_table[33])
(::grpc_core::g_static_metadata_slice_table[25])
/* "deflate" */
#define GRPC_MDSTR_DEFLATE (::grpc_core::g_static_metadata_slice_table[34])
#define GRPC_MDSTR_DEFLATE (::grpc_core::g_static_metadata_slice_table[26])
/* "gzip" */
#define GRPC_MDSTR_GZIP (::grpc_core::g_static_metadata_slice_table[35])
#define GRPC_MDSTR_GZIP (::grpc_core::g_static_metadata_slice_table[27])
/* "stream/gzip" */
#define GRPC_MDSTR_STREAM_SLASH_GZIP \
(::grpc_core::g_static_metadata_slice_table[36])
(::grpc_core::g_static_metadata_slice_table[28])
/* "te" */
#define GRPC_MDSTR_TE (::grpc_core::g_static_metadata_slice_table[37])
#define GRPC_MDSTR_TE (::grpc_core::g_static_metadata_slice_table[29])
/* "trailers" */
#define GRPC_MDSTR_TRAILERS (::grpc_core::g_static_metadata_slice_table[38])
#define GRPC_MDSTR_TRAILERS (::grpc_core::g_static_metadata_slice_table[30])
/* "GET" */
#define GRPC_MDSTR_GET (::grpc_core::g_static_metadata_slice_table[39])
#define GRPC_MDSTR_GET (::grpc_core::g_static_metadata_slice_table[31])
/* "POST" */
#define GRPC_MDSTR_POST (::grpc_core::g_static_metadata_slice_table[40])
#define GRPC_MDSTR_POST (::grpc_core::g_static_metadata_slice_table[32])
/* "/" */
#define GRPC_MDSTR_SLASH (::grpc_core::g_static_metadata_slice_table[41])
#define GRPC_MDSTR_SLASH (::grpc_core::g_static_metadata_slice_table[33])
/* "/index.html" */
#define GRPC_MDSTR_SLASH_INDEX_DOT_HTML \
(::grpc_core::g_static_metadata_slice_table[42])
(::grpc_core::g_static_metadata_slice_table[34])
/* "http" */
#define GRPC_MDSTR_HTTP (::grpc_core::g_static_metadata_slice_table[43])
#define GRPC_MDSTR_HTTP (::grpc_core::g_static_metadata_slice_table[35])
/* "https" */
#define GRPC_MDSTR_HTTPS (::grpc_core::g_static_metadata_slice_table[44])
#define GRPC_MDSTR_HTTPS (::grpc_core::g_static_metadata_slice_table[36])
/* "200" */
#define GRPC_MDSTR_200 (::grpc_core::g_static_metadata_slice_table[45])
#define GRPC_MDSTR_200 (::grpc_core::g_static_metadata_slice_table[37])
/* "204" */
#define GRPC_MDSTR_204 (::grpc_core::g_static_metadata_slice_table[46])
#define GRPC_MDSTR_204 (::grpc_core::g_static_metadata_slice_table[38])
/* "206" */
#define GRPC_MDSTR_206 (::grpc_core::g_static_metadata_slice_table[47])
#define GRPC_MDSTR_206 (::grpc_core::g_static_metadata_slice_table[39])
/* "304" */
#define GRPC_MDSTR_304 (::grpc_core::g_static_metadata_slice_table[48])
#define GRPC_MDSTR_304 (::grpc_core::g_static_metadata_slice_table[40])
/* "400" */
#define GRPC_MDSTR_400 (::grpc_core::g_static_metadata_slice_table[49])
#define GRPC_MDSTR_400 (::grpc_core::g_static_metadata_slice_table[41])
/* "404" */
#define GRPC_MDSTR_404 (::grpc_core::g_static_metadata_slice_table[50])
#define GRPC_MDSTR_404 (::grpc_core::g_static_metadata_slice_table[42])
/* "500" */
#define GRPC_MDSTR_500 (::grpc_core::g_static_metadata_slice_table[51])
#define GRPC_MDSTR_500 (::grpc_core::g_static_metadata_slice_table[43])
/* "accept-charset" */
#define GRPC_MDSTR_ACCEPT_CHARSET \
(::grpc_core::g_static_metadata_slice_table[52])
(::grpc_core::g_static_metadata_slice_table[44])
/* "gzip, deflate" */
#define GRPC_MDSTR_GZIP_COMMA_DEFLATE \
(::grpc_core::g_static_metadata_slice_table[53])
(::grpc_core::g_static_metadata_slice_table[45])
/* "accept-language" */
#define GRPC_MDSTR_ACCEPT_LANGUAGE \
(::grpc_core::g_static_metadata_slice_table[54])
(::grpc_core::g_static_metadata_slice_table[46])
/* "accept-ranges" */
#define GRPC_MDSTR_ACCEPT_RANGES \
(::grpc_core::g_static_metadata_slice_table[55])
(::grpc_core::g_static_metadata_slice_table[47])
/* "accept" */
#define GRPC_MDSTR_ACCEPT (::grpc_core::g_static_metadata_slice_table[56])
#define GRPC_MDSTR_ACCEPT (::grpc_core::g_static_metadata_slice_table[48])
/* "access-control-allow-origin" */
#define GRPC_MDSTR_ACCESS_CONTROL_ALLOW_ORIGIN \
(::grpc_core::g_static_metadata_slice_table[57])
(::grpc_core::g_static_metadata_slice_table[49])
/* "age" */
#define GRPC_MDSTR_AGE (::grpc_core::g_static_metadata_slice_table[58])
#define GRPC_MDSTR_AGE (::grpc_core::g_static_metadata_slice_table[50])
/* "allow" */
#define GRPC_MDSTR_ALLOW (::grpc_core::g_static_metadata_slice_table[59])
#define GRPC_MDSTR_ALLOW (::grpc_core::g_static_metadata_slice_table[51])
/* "authorization" */
#define GRPC_MDSTR_AUTHORIZATION \
(::grpc_core::g_static_metadata_slice_table[60])
(::grpc_core::g_static_metadata_slice_table[52])
/* "cache-control" */
#define GRPC_MDSTR_CACHE_CONTROL \
(::grpc_core::g_static_metadata_slice_table[61])
(::grpc_core::g_static_metadata_slice_table[53])
/* "content-disposition" */
#define GRPC_MDSTR_CONTENT_DISPOSITION \
(::grpc_core::g_static_metadata_slice_table[62])
(::grpc_core::g_static_metadata_slice_table[54])
/* "content-language" */
#define GRPC_MDSTR_CONTENT_LANGUAGE \
(::grpc_core::g_static_metadata_slice_table[63])
(::grpc_core::g_static_metadata_slice_table[55])
/* "content-length" */
#define GRPC_MDSTR_CONTENT_LENGTH \
(::grpc_core::g_static_metadata_slice_table[64])
(::grpc_core::g_static_metadata_slice_table[56])
/* "content-location" */
#define GRPC_MDSTR_CONTENT_LOCATION \
(::grpc_core::g_static_metadata_slice_table[65])
(::grpc_core::g_static_metadata_slice_table[57])
/* "content-range" */
#define GRPC_MDSTR_CONTENT_RANGE \
(::grpc_core::g_static_metadata_slice_table[66])
(::grpc_core::g_static_metadata_slice_table[58])
/* "cookie" */
#define GRPC_MDSTR_COOKIE (::grpc_core::g_static_metadata_slice_table[67])
#define GRPC_MDSTR_COOKIE (::grpc_core::g_static_metadata_slice_table[59])
/* "date" */
#define GRPC_MDSTR_DATE (::grpc_core::g_static_metadata_slice_table[68])
#define GRPC_MDSTR_DATE (::grpc_core::g_static_metadata_slice_table[60])
/* "etag" */
#define GRPC_MDSTR_ETAG (::grpc_core::g_static_metadata_slice_table[69])
#define GRPC_MDSTR_ETAG (::grpc_core::g_static_metadata_slice_table[61])
/* "expect" */
#define GRPC_MDSTR_EXPECT (::grpc_core::g_static_metadata_slice_table[70])
#define GRPC_MDSTR_EXPECT (::grpc_core::g_static_metadata_slice_table[62])
/* "expires" */
#define GRPC_MDSTR_EXPIRES (::grpc_core::g_static_metadata_slice_table[71])
#define GRPC_MDSTR_EXPIRES (::grpc_core::g_static_metadata_slice_table[63])
/* "from" */
#define GRPC_MDSTR_FROM (::grpc_core::g_static_metadata_slice_table[72])
#define GRPC_MDSTR_FROM (::grpc_core::g_static_metadata_slice_table[64])
/* "host" */
#define GRPC_MDSTR_HOST (::grpc_core::g_static_metadata_slice_table[65])
/* "if-match" */
#define GRPC_MDSTR_IF_MATCH (::grpc_core::g_static_metadata_slice_table[73])
#define GRPC_MDSTR_IF_MATCH (::grpc_core::g_static_metadata_slice_table[66])
/* "if-modified-since" */
#define GRPC_MDSTR_IF_MODIFIED_SINCE \
(::grpc_core::g_static_metadata_slice_table[74])
(::grpc_core::g_static_metadata_slice_table[67])
/* "if-none-match" */
#define GRPC_MDSTR_IF_NONE_MATCH \
(::grpc_core::g_static_metadata_slice_table[75])
(::grpc_core::g_static_metadata_slice_table[68])
/* "if-range" */
#define GRPC_MDSTR_IF_RANGE (::grpc_core::g_static_metadata_slice_table[76])
#define GRPC_MDSTR_IF_RANGE (::grpc_core::g_static_metadata_slice_table[69])
/* "if-unmodified-since" */
#define GRPC_MDSTR_IF_UNMODIFIED_SINCE \
(::grpc_core::g_static_metadata_slice_table[77])
(::grpc_core::g_static_metadata_slice_table[70])
/* "last-modified" */
#define GRPC_MDSTR_LAST_MODIFIED \
(::grpc_core::g_static_metadata_slice_table[78])
(::grpc_core::g_static_metadata_slice_table[71])
/* "link" */
#define GRPC_MDSTR_LINK (::grpc_core::g_static_metadata_slice_table[79])
#define GRPC_MDSTR_LINK (::grpc_core::g_static_metadata_slice_table[72])
/* "location" */
#define GRPC_MDSTR_LOCATION (::grpc_core::g_static_metadata_slice_table[80])
#define GRPC_MDSTR_LOCATION (::grpc_core::g_static_metadata_slice_table[73])
/* "max-forwards" */
#define GRPC_MDSTR_MAX_FORWARDS (::grpc_core::g_static_metadata_slice_table[81])
#define GRPC_MDSTR_MAX_FORWARDS (::grpc_core::g_static_metadata_slice_table[74])
/* "proxy-authenticate" */
#define GRPC_MDSTR_PROXY_AUTHENTICATE \
(::grpc_core::g_static_metadata_slice_table[82])
(::grpc_core::g_static_metadata_slice_table[75])
/* "proxy-authorization" */
#define GRPC_MDSTR_PROXY_AUTHORIZATION \
(::grpc_core::g_static_metadata_slice_table[83])
(::grpc_core::g_static_metadata_slice_table[76])
/* "range" */
#define GRPC_MDSTR_RANGE (::grpc_core::g_static_metadata_slice_table[84])
#define GRPC_MDSTR_RANGE (::grpc_core::g_static_metadata_slice_table[77])
/* "referer" */
#define GRPC_MDSTR_REFERER (::grpc_core::g_static_metadata_slice_table[85])
#define GRPC_MDSTR_REFERER (::grpc_core::g_static_metadata_slice_table[78])
/* "refresh" */
#define GRPC_MDSTR_REFRESH (::grpc_core::g_static_metadata_slice_table[86])
#define GRPC_MDSTR_REFRESH (::grpc_core::g_static_metadata_slice_table[79])
/* "retry-after" */
#define GRPC_MDSTR_RETRY_AFTER (::grpc_core::g_static_metadata_slice_table[87])
#define GRPC_MDSTR_RETRY_AFTER (::grpc_core::g_static_metadata_slice_table[80])
/* "server" */
#define GRPC_MDSTR_SERVER (::grpc_core::g_static_metadata_slice_table[88])
#define GRPC_MDSTR_SERVER (::grpc_core::g_static_metadata_slice_table[81])
/* "set-cookie" */
#define GRPC_MDSTR_SET_COOKIE (::grpc_core::g_static_metadata_slice_table[89])
#define GRPC_MDSTR_SET_COOKIE (::grpc_core::g_static_metadata_slice_table[82])
/* "strict-transport-security" */
#define GRPC_MDSTR_STRICT_TRANSPORT_SECURITY \
(::grpc_core::g_static_metadata_slice_table[90])
(::grpc_core::g_static_metadata_slice_table[83])
/* "transfer-encoding" */
#define GRPC_MDSTR_TRANSFER_ENCODING \
(::grpc_core::g_static_metadata_slice_table[91])
(::grpc_core::g_static_metadata_slice_table[84])
/* "user-agent" */
#define GRPC_MDSTR_USER_AGENT (::grpc_core::g_static_metadata_slice_table[85])
/* "vary" */
#define GRPC_MDSTR_VARY (::grpc_core::g_static_metadata_slice_table[92])
#define GRPC_MDSTR_VARY (::grpc_core::g_static_metadata_slice_table[86])
/* "via" */
#define GRPC_MDSTR_VIA (::grpc_core::g_static_metadata_slice_table[93])
#define GRPC_MDSTR_VIA (::grpc_core::g_static_metadata_slice_table[87])
/* "www-authenticate" */
#define GRPC_MDSTR_WWW_AUTHENTICATE \
(::grpc_core::g_static_metadata_slice_table[94])
(::grpc_core::g_static_metadata_slice_table[88])
/* "0" */
#define GRPC_MDSTR_0 (::grpc_core::g_static_metadata_slice_table[95])
#define GRPC_MDSTR_0 (::grpc_core::g_static_metadata_slice_table[89])
/* "identity" */
#define GRPC_MDSTR_IDENTITY (::grpc_core::g_static_metadata_slice_table[96])
#define GRPC_MDSTR_IDENTITY (::grpc_core::g_static_metadata_slice_table[90])
/* "application/grpc" */
#define GRPC_MDSTR_APPLICATION_SLASH_GRPC \
(::grpc_core::g_static_metadata_slice_table[97])
(::grpc_core::g_static_metadata_slice_table[91])
/* "grpc" */
#define GRPC_MDSTR_GRPC (::grpc_core::g_static_metadata_slice_table[98])
#define GRPC_MDSTR_GRPC (::grpc_core::g_static_metadata_slice_table[92])
/* "PUT" */
#define GRPC_MDSTR_PUT (::grpc_core::g_static_metadata_slice_table[99])
#define GRPC_MDSTR_PUT (::grpc_core::g_static_metadata_slice_table[93])
/* "lb-cost-bin" */
#define GRPC_MDSTR_LB_COST_BIN (::grpc_core::g_static_metadata_slice_table[100])
#define GRPC_MDSTR_LB_COST_BIN (::grpc_core::g_static_metadata_slice_table[94])
/* "identity,deflate" */
#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE \
(::grpc_core::g_static_metadata_slice_table[101])
(::grpc_core::g_static_metadata_slice_table[95])
/* "identity,gzip" */
#define GRPC_MDSTR_IDENTITY_COMMA_GZIP \
(::grpc_core::g_static_metadata_slice_table[102])
(::grpc_core::g_static_metadata_slice_table[96])
/* "deflate,gzip" */
#define GRPC_MDSTR_DEFLATE_COMMA_GZIP \
(::grpc_core::g_static_metadata_slice_table[103])
(::grpc_core::g_static_metadata_slice_table[97])
/* "identity,deflate,gzip" */
#define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE_COMMA_GZIP \
(::grpc_core::g_static_metadata_slice_table[104])
(::grpc_core::g_static_metadata_slice_table[98])
namespace grpc_core {
extern StaticSliceRefcount

@ -899,7 +899,6 @@ static grpc_metadata* get_md_elem(grpc_metadata* metadata,
static int prepare_application_metadata(grpc_call* call, int count,
grpc_metadata* metadata,
int is_trailing,
int prepend_extra_metadata,
grpc_metadata* additional_metadata,
int additional_metadata_count) {
int total_count = count + additional_metadata_count;
@ -932,16 +931,6 @@ static int prepare_application_metadata(grpc_call* call, int count,
}
return 0;
}
if (prepend_extra_metadata) {
if (call->send_extra_metadata_count == 0) {
prepend_extra_metadata = 0;
} else {
for (i = 0; i < call->send_extra_metadata_count; i++) {
GRPC_LOG_IF_ERROR("prepare_application_metadata",
batch->LinkTail(&call->send_extra_metadata[i]));
}
}
}
for (i = 0; i < total_count; i++) {
grpc_metadata* md = get_md_elem(metadata, additional_metadata, i, count);
grpc_linked_mdelem* l = linked_from_md(md);
@ -951,7 +940,6 @@ static int prepare_application_metadata(grpc_call* call, int count,
}
GRPC_LOG_IF_ERROR("prepare_application_metadata", error);
}
call->send_extra_metadata_count = 0;
return 1;
}
@ -1089,12 +1077,10 @@ static void recv_trailing_filter(void* args, grpc_metadata_batch* b,
static_cast<intptr_t>(status_code));
gpr_free(peer);
}
if (b->legacy_index()->named.grpc_message != nullptr) {
error = grpc_error_set_str(
error, GRPC_ERROR_STR_GRPC_MESSAGE,
grpc_core::StringViewFromSlice(
GRPC_MDVALUE(b->legacy_index()->named.grpc_message->md)));
b->Remove(GRPC_BATCH_GRPC_MESSAGE);
auto grpc_message = b->Take(grpc_core::GrpcMessageMetadata());
if (grpc_message.has_value()) {
error = grpc_error_set_str(error, GRPC_ERROR_STR_GRPC_MESSAGE,
grpc_message->as_string_view());
} else if (error != GRPC_ERROR_NONE) {
error = grpc_error_set_str(error, GRPC_ERROR_STR_GRPC_MESSAGE, "");
}
@ -1675,10 +1661,20 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
}
stream_op->send_initial_metadata = true;
call->sent_initial_metadata = true;
if (call->is_client) {
// TODO(ctiller): this will turn into explicit Set() calls once we
// migrate :path, :authority.
for (int i = 0; i < call->send_extra_metadata_count; i++) {
GRPC_LOG_IF_ERROR("prepare_client_metadata",
call->send_initial_metadata.LinkTail(
&call->send_extra_metadata[i]));
}
call->send_extra_metadata_count = 0;
}
if (!prepare_application_metadata(
call, static_cast<int>(op->data.send_initial_metadata.count),
op->data.send_initial_metadata.metadata, 0, call->is_client,
&compression_md, static_cast<int>(additional_metadata_count))) {
op->data.send_initial_metadata.metadata, 0, &compression_md,
static_cast<int>(additional_metadata_count))) {
error = GRPC_CALL_ERROR_INVALID_METADATA;
goto done_with_error;
}
@ -1770,10 +1766,17 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
}
stream_op->send_trailing_metadata = true;
call->sent_final_op = true;
GPR_ASSERT(call->send_extra_metadata_count == 0);
call->send_extra_metadata_count = 1;
call->send_extra_metadata[0].md = grpc_get_reffed_status_elem(
op->data.send_status_from_server.status);
if (!prepare_application_metadata(
call,
static_cast<int>(
op->data.send_status_from_server.trailing_metadata_count),
op->data.send_status_from_server.trailing_metadata, 1, nullptr,
0)) {
error = GRPC_CALL_ERROR_INVALID_METADATA;
goto done_with_error;
}
grpc_error_handle status_error =
op->data.send_status_from_server.status == GRPC_STATUS_OK
? GRPC_ERROR_NONE
@ -1784,36 +1787,26 @@ static grpc_call_error call_start_batch(grpc_call* call, const grpc_op* ops,
static_cast<intptr_t>(
op->data.send_status_from_server.status));
if (op->data.send_status_from_server.status_details != nullptr) {
call->send_extra_metadata[1].md = grpc_mdelem_from_slices(
GRPC_MDSTR_GRPC_MESSAGE,
grpc_slice_copy(
*op->data.send_status_from_server.status_details));
call->send_extra_metadata_count++;
call->send_trailing_metadata.Set(
grpc_core::GrpcMessageMetadata(),
grpc_core::Slice(grpc_slice_copy(
*op->data.send_status_from_server.status_details)));
if (status_error != GRPC_ERROR_NONE) {
char* msg = grpc_slice_to_c_string(
GRPC_MDVALUE(call->send_extra_metadata[1].md));
status_error = grpc_error_set_str(status_error,
GRPC_ERROR_STR_GRPC_MESSAGE, msg);
gpr_free(msg);
status_error = grpc_error_set_str(
status_error, GRPC_ERROR_STR_GRPC_MESSAGE,
grpc_core::StringViewFromSlice(
*op->data.send_status_from_server.status_details));
}
}
call->status_error.set(status_error);
GRPC_ERROR_UNREF(status_error);
if (!prepare_application_metadata(
call,
static_cast<int>(
op->data.send_status_from_server.trailing_metadata_count),
op->data.send_status_from_server.trailing_metadata, 1, 1,
nullptr, 0)) {
for (int n = 0; n < call->send_extra_metadata_count; n++) {
GRPC_MDELEM_UNREF(call->send_extra_metadata[n].md);
}
call->send_extra_metadata_count = 0;
error = GRPC_CALL_ERROR_INVALID_METADATA;
goto done_with_error;
}
GRPC_LOG_IF_ERROR(
"set call status",
call->send_trailing_metadata.Append(grpc_get_reffed_status_elem(
op->data.send_status_from_server.status)));
stream_op_payload->send_trailing_metadata.send_trailing_metadata =
&call->send_trailing_metadata;
stream_op_payload->send_trailing_metadata.sent =

@ -138,11 +138,9 @@ struct TeMetadata {
}
};
// user-agent metadata trait.
struct UserAgentMetadata {
struct SimpleSliceBasedMetadata {
using ValueType = Slice;
using MementoType = Slice;
static absl::string_view key() { return "user-agent"; }
static MementoType ParseMemento(Slice value) { return value.TakeOwned(); }
static ValueType MementoToValue(MementoType value) { return value; }
static Slice Encode(const ValueType& x) { return x.Ref(); }
@ -151,68 +149,139 @@ struct UserAgentMetadata {
}
};
// user-agent metadata trait.
struct UserAgentMetadata : public SimpleSliceBasedMetadata {
static absl::string_view key() { return "user-agent"; }
};
// grpc-message metadata trait.
struct GrpcMessageMetadata : public SimpleSliceBasedMetadata {
static absl::string_view key() { return "grpc-message"; }
};
// host metadata trait.
struct HostMetadata : public SimpleSliceBasedMetadata {
static absl::string_view key() { return "host"; }
};
// x-endpoint-load-metrics-bin metadata trait.
struct XEndpointLoadMetricsBinMetadata : public SimpleSliceBasedMetadata {
static absl::string_view key() { return "x-endpoint-load-metrics-bin"; }
};
// grpc-server-stats-bin metadata trait.
struct GrpcServerStatsBinMetadata : public SimpleSliceBasedMetadata {
static absl::string_view key() { return "grpc-server-stats-bin"; }
};
// grpc-trace-bin metadata trait.
struct GrpcTraceBinMetadata : public SimpleSliceBasedMetadata {
static absl::string_view key() { return "grpc-trace-bin"; }
};
// grpc-tags-bin metadata trait.
struct GrpcTagsBinMetadata : public SimpleSliceBasedMetadata {
static absl::string_view key() { return "grpc-tags-bin"; }
};
namespace metadata_detail {
// Inner implementation of MetadataMap<Container>::Parse()
// Recursive in terms of metadata trait, tries each known type in order by doing
// a string comparison on key, and if that key is found parses it. If not found,
// calls not_found to generate the result value.
template <typename Container, typename... Traits>
struct ParseHelper;
template <typename Container, typename Trait, typename... Traits>
struct ParseHelper<Container, Trait, Traits...> {
template <typename NotFound>
static ParsedMetadata<Container> Parse(absl::string_view key, Slice value,
uint32_t transport_size,
NotFound not_found) {
// Helper type - maps a string name to a trait.
template <typename... Traits>
struct NameLookup;
template <typename Trait, typename... Traits>
struct NameLookup<Trait, Traits...> {
// Call op->Found(Trait()) if op->name == Trait::key() for some Trait in
// Traits. If not found, call op->NotFount().
template <typename Op>
static auto Lookup(absl::string_view key, Op* op)
-> decltype(op->Found(Trait())) {
if (key == Trait::key()) {
return ParsedMetadata<Container>(
Trait(), Trait::ParseMemento(value.TakeOwned()), transport_size);
return op->Found(Trait());
}
return ParseHelper<Container, Traits...>::Parse(key, std::move(value),
transport_size, not_found);
return NameLookup<Traits...>::Lookup(key, op);
}
};
template <typename Container>
struct ParseHelper<Container> {
template <typename NotFound>
static ParsedMetadata<Container> Parse(absl::string_view, Slice value,
uint32_t, NotFound not_found) {
return not_found(std::move(value));
template <>
struct NameLookup<> {
template <typename Op>
static auto Lookup(absl::string_view key, Op* op)
-> decltype(op->NotFound(key)) {
return op->NotFound(key);
}
};
// Inner implementation of MetadataMap<Container>::Append()
// Recursive in terms of metadata trait, tries each known type in order by doing
// a string comparison on key, and if that key is found sets it. If not found,
// calls not_found to append generically.
template <typename Container, typename... Traits>
struct AppendHelper;
template <typename Container, typename Trait, typename... Traits>
struct AppendHelper<Container, Trait, Traits...> {
template <typename NotFound>
static void Append(Container* container, absl::string_view key, Slice value,
NotFound not_found) {
if (key == Trait::key()) {
container->Set(Trait(), Trait::MementoToValue(
Trait::ParseMemento(value.TakeOwned())));
return;
}
AppendHelper<Container, Traits...>::Append(container, key, std::move(value),
not_found);
// Helper to take a slice to a memento to a value.
// By splitting this part out we can scale code size as the number of (memento,
// value) types, rather than as the number of traits.
template <typename ParseMementoFn, typename MementoToValueFn>
struct ParseValue {
template <ParseMementoFn parse_memento, MementoToValueFn memento_to_value>
static GPR_ATTRIBUTE_NOINLINE auto Parse(Slice* value)
-> decltype(memento_to_value(parse_memento(std::move(*value)))) {
return memento_to_value(parse_memento(std::move(*value)));
}
};
// This is an "Op" type for NameLookup.
// Used for MetadataMap::Parse, its Found/NotFound methods turn a slice into a
// ParsedMetadata object.
template <typename Container>
struct AppendHelper<Container> {
template <typename NotFound>
static void Append(Container*, absl::string_view, Slice value,
NotFound not_found) {
not_found(std::move(value));
class ParseHelper {
public:
ParseHelper(Slice value, size_t transport_size)
: value_(std::move(value)), transport_size_(transport_size) {}
template <typename Trait>
ParsedMetadata<Container> Found(Trait trait) {
return ParsedMetadata<Container>(
trait, Trait::ParseMemento(std::move(value_)), transport_size_);
}
GPR_ATTRIBUTE_NOINLINE ParsedMetadata<Container> NotFound(
absl::string_view key) {
return ParsedMetadata<Container>(
grpc_mdelem_from_slices(grpc_slice_intern(grpc_slice_from_static_buffer(
key.data(), key.size())),
value_.TakeCSlice()));
}
private:
Slice value_;
const size_t transport_size_;
};
// This is an "Op" type for NameLookup.
// Used for MetadataMap::Parse, its Found/NotFound methods turn a slice into a
// value and add it to a container.
template <typename Container>
class AppendHelper {
public:
AppendHelper(Container* container, Slice value)
: container_(container), value_(std::move(value)) {}
template <typename Trait>
GPR_ATTRIBUTE_NOINLINE void Found(Trait trait) {
container_->Set(
trait, ParseValue<decltype(Trait::ParseMemento),
decltype(Trait::MementoToValue)>::
template Parse<Trait::ParseMemento, Trait::MementoToValue>(
&value_));
}
void NotFound(absl::string_view key) {
GPR_ASSERT(GRPC_ERROR_NONE ==
container_->Append(grpc_mdelem_from_slices(
grpc_slice_intern(
grpc_slice_from_static_buffer(key.data(), key.length())),
value_.TakeCSlice())));
}
private:
Container* const container_;
Slice value_;
};
} // namespace metadata_detail
@ -239,7 +308,7 @@ struct AppendHelper<Container> {
// // The type that's stored in compression/decompression tables
// using MementoType = ...;
// // The string key for this metadata type (for transports that require it)
// static constexpr absl::string_view key() { return "grpc-xyz"; }
// static absl::string_view key() { return "grpc-xyz"; }
// // Parse a memento from a slice
// // Takes ownership of value
// static MementoType ParseMemento(Slice value) { ... }
@ -352,9 +421,12 @@ class MetadataMap {
// m.Remove(T());
template <typename Which>
absl::optional<typename Which::ValueType> Take(Which which) {
auto value = get(which);
Remove(which);
return value;
if (auto* p = get_pointer(which)) {
absl::optional<typename Which::ValueType> value(std::move(*p));
Remove(which);
return value;
}
return {};
}
// Parse metadata from a key/value pair, and return an object representing
@ -363,16 +435,9 @@ class MetadataMap {
// Once we don't care about interning anymore, make that change!
static ParsedMetadata<MetadataMap> Parse(absl::string_view key, Slice value,
uint32_t transport_size) {
bool parsed = true;
auto out = metadata_detail::ParseHelper<MetadataMap, Traits...>::Parse(
key, std::move(value), transport_size, [&](Slice value) {
parsed = false;
return ParsedMetadata<MetadataMap>(grpc_mdelem_from_slices(
grpc_slice_intern(
grpc_slice_from_static_buffer(key.data(), key.size())),
value.TakeCSlice()));
});
return out;
metadata_detail::ParseHelper<MetadataMap> helper(value.TakeOwned(),
transport_size);
return metadata_detail::NameLookup<Traits...>::Lookup(key, &helper);
}
// Set a value from a parsed metadata object.
@ -383,14 +448,8 @@ class MetadataMap {
// Append a key/value pair - takes ownership of value
void Append(absl::string_view key, Slice value) {
metadata_detail::AppendHelper<MetadataMap, Traits...>::Append(
this, key, std::move(value), [this, key](Slice value) {
GPR_ASSERT(GRPC_ERROR_NONE ==
Append(grpc_mdelem_from_slices(
grpc_slice_intern(grpc_slice_from_static_buffer(
key.data(), key.length())),
value.TakeCSlice())));
});
metadata_detail::AppendHelper<MetadataMap> helper(this, value.TakeOwned());
metadata_detail::NameLookup<Traits...>::Lookup(key, &helper);
}
//
@ -908,9 +967,12 @@ bool MetadataMap<Traits...>::ReplaceIfExists(grpc_slice key, grpc_slice value) {
} // namespace grpc_core
using grpc_metadata_batch =
grpc_core::MetadataMap<grpc_core::GrpcTimeoutMetadata,
grpc_core::TeMetadata, grpc_core::UserAgentMetadata>;
using grpc_metadata_batch = grpc_core::MetadataMap<
grpc_core::GrpcTimeoutMetadata, grpc_core::TeMetadata,
grpc_core::UserAgentMetadata, grpc_core::GrpcMessageMetadata,
grpc_core::HostMetadata, grpc_core::XEndpointLoadMetricsBinMetadata,
grpc_core::GrpcServerStatsBinMetadata, grpc_core::GrpcTraceBinMetadata,
grpc_core::GrpcTagsBinMetadata>;
inline void grpc_metadata_batch_clear(grpc_metadata_batch* batch) {
batch->Clear();

@ -0,0 +1,35 @@
// Copyright 2021 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <grpc/support/port_platform.h>
#include "src/core/lib/transport/parsed_metadata.h"
namespace grpc_core {
namespace metadata_detail {
std::string MakeDebugString(absl::string_view key, absl::string_view value) {
return absl::StrCat(key, ": ", value);
}
Slice SliceFromBuffer(const Buffer& buffer) {
return Slice(grpc_slice_ref_internal(buffer.slice));
}
void DestroySliceValue(const Buffer& value) {
grpc_slice_unref_internal(value.slice);
}
} // namespace metadata_detail
} // namespace grpc_core

@ -41,6 +41,51 @@ struct HasSimpleMemento {
sizeof(typename Which::MementoType) <= sizeof(uint64_t);
};
// Storage type for a single metadata entry.
union Buffer {
uint64_t trivial;
void* pointer;
grpc_slice slice;
grpc_mdelem mdelem;
};
// Given a key and a value, concatenate together to make a debug string.
// Split out to avoid template bloat.
std::string MakeDebugString(absl::string_view key, absl::string_view value);
// Wrapper around MakeDebugString.
// For the value part, use two functions - one to extract a typed field from
// Buffer, and a second (sourced from the trait) to generate a displayable debug
// string from the field value. We try to maximize indirection/code sharing here
// as this is not critical path code and we'd like to avoid some code bloat -
// better to scale by number of types than then number of metadata traits!
template <typename Field, typename CompatibleWithField, typename Display>
GPR_ATTRIBUTE_NOINLINE std::string MakeDebugStringPipeline(
absl::string_view key, const Buffer& value,
Field (*field_from_buffer)(const Buffer&),
Display (*display_from_field)(CompatibleWithField)) {
return MakeDebugString(
key, absl::StrCat(display_from_field(field_from_buffer(value))));
}
// Extract a trivial field value from a Buffer - for MakeDebugStringPipeline.
template <typename Field>
Field FieldFromTrivial(const Buffer& value) {
return static_cast<Field>(value.trivial);
}
// Extract a pointer field value from a Buffer - for MakeDebugStringPipeline.
template <typename Field>
Field FieldFromPointer(const Buffer& value) {
return *static_cast<const Field*>(value.pointer);
}
// Extract a Slice from a Buffer.
Slice SliceFromBuffer(const Buffer& buffer);
// Unref the grpc_slice part of a Buffer (assumes it is in fact a grpc_slice).
void DestroySliceValue(const Buffer& value);
} // namespace metadata_detail
// A parsed metadata value.
@ -77,6 +122,7 @@ class ParsedMetadata {
transport_size_(transport_size) {
value_.pointer = new typename Which::MementoType(std::move(value));
}
// Construct metadata from a Slice typed value.
template <typename Which>
ParsedMetadata(Which, Slice value, uint32_t transport_size)
: vtable_(ParsedMetadata::template SliceTraitVTable<Which>()),
@ -123,7 +169,13 @@ class ParsedMetadata {
uint32_t transport_size() const { return transport_size_; }
// Create a new parsed metadata with the same key but a different value.
ParsedMetadata WithNewValue(Slice value) const {
return vtable_->with_new_value(value_, &value);
ParsedMetadata result;
result.vtable_ = vtable_;
result.value_ = value_;
result.transport_size_ =
TransportSize(vtable_->key_length(value_), value.length());
vtable_->with_new_value(&value, &result);
return result;
}
std::string DebugString() const { return vtable_->debug_string(value_); }
@ -134,24 +186,19 @@ class ParsedMetadata {
}
private:
union Buffer {
uint64_t trivial;
void* pointer;
grpc_slice slice;
grpc_mdelem mdelem;
};
using Buffer = metadata_detail::Buffer;
struct VTable {
const bool is_binary_header;
void (*const destroy)(const Buffer& value);
grpc_error_handle (*const set)(const Buffer& value,
MetadataContainer* container);
// TODO(ctiller): ideally we'd pass new_value by value here, but there was
// an apparent miscompile with gcc-4.9 and WithNewValue - passing a pointer
// here fixed it.
ParsedMetadata (*const with_new_value)(const Buffer& value,
Slice* new_value);
std::string (*debug_string)(const Buffer& value);
// result is a bitwise copy of the originating ParsedMetadata.
void (*const with_new_value)(Slice* new_value, ParsedMetadata* result);
std::string (*const debug_string)(const Buffer& value);
// TODO(ctiller): when we delete mdelem, make this a simple integer constant
// on the vtable
size_t (*const key_length)(const Buffer& value);
};
static const VTable* EmptyVTable();
@ -164,11 +211,18 @@ class ParsedMetadata {
template <bool kIsBinaryHeader>
static const VTable* MdelemVtable();
template <Slice (*ParseMemento)(Slice)>
GPR_ATTRIBUTE_NOINLINE void WithNewValueSetSlice(Slice* slice) {
value_.slice = ParseMemento(std::move(*slice)).TakeCSlice();
}
const VTable* vtable_;
Buffer value_;
uint32_t transport_size_;
};
namespace metadata_detail {} // namespace metadata_detail
template <typename MetadataContainer>
const typename ParsedMetadata<MetadataContainer>::VTable*
ParsedMetadata<MetadataContainer>::EmptyVTable() {
@ -179,9 +233,12 @@ ParsedMetadata<MetadataContainer>::EmptyVTable() {
// set
[](const Buffer&, MetadataContainer*) { return GRPC_ERROR_NONE; },
// with_new_value
[](const Buffer&, Slice*) { return ParsedMetadata(); },
[](Slice*, ParsedMetadata*) {},
// debug_string
[](const Buffer&) -> std::string { return "empty"; }};
[](const Buffer&) -> std::string { return "empty"; },
// key_length
[](const Buffer&) -> size_t { return 0; },
};
return &vtable;
}
@ -201,18 +258,19 @@ ParsedMetadata<MetadataContainer>::TrivialTraitVTable() {
return GRPC_ERROR_NONE;
},
// with_new_value
[](const Buffer&, Slice* value) {
const auto length = value->length();
return ParsedMetadata(Which(), Which::ParseMemento(std::move(*value)),
TransportSize(Which::key().length(), length));
[](Slice* value, ParsedMetadata* result) {
result->value_.trivial = Which::ParseMemento(std::move(*value));
},
// debug_string
[](const Buffer& value) {
return absl::StrCat(
Which::key(), ": ",
Which::DisplayValue(
static_cast<typename Which::MementoType>(value.trivial)));
}};
return metadata_detail::MakeDebugStringPipeline(
Which::key(), value,
metadata_detail::FieldFromTrivial<typename Which::MementoType>,
Which::DisplayValue);
},
// key_length
[](const Buffer&) { return Which::key().size(); },
};
return &vtable;
}
@ -233,16 +291,20 @@ ParsedMetadata<MetadataContainer>::NonTrivialTraitVTable() {
return GRPC_ERROR_NONE;
},
// with_new_value
[](const Buffer&, Slice* value) {
const auto length = value->length();
return ParsedMetadata(Which(), Which::ParseMemento(std::move(*value)),
TransportSize(Which::key().length(), length));
[](Slice* value, ParsedMetadata* result) {
result->value_.pointer = new
typename Which::MementoType(Which::ParseMemento(std::move(*value)));
},
// debug_string
[](const Buffer& value) {
auto* p = static_cast<typename Which::MementoType*>(value.pointer);
return absl::StrCat(Which::key(), ": ", Which::DisplayValue(*p));
}};
return metadata_detail::MakeDebugStringPipeline(
Which::key(), value,
metadata_detail::FieldFromPointer<typename Which::MementoType>,
Which::DisplayValue);
},
// key_length
[](const Buffer&) { return Which::key().size(); },
};
return &vtable;
}
@ -253,24 +315,26 @@ ParsedMetadata<MetadataContainer>::SliceTraitVTable() {
static const VTable vtable = {
absl::EndsWith(Which::key(), "-bin"),
// destroy
[](const Buffer& value) { grpc_slice_unref_internal(value.slice); },
metadata_detail::DestroySliceValue,
// set
[](const Buffer& value, MetadataContainer* map) {
map->Set(Which(), Slice(grpc_slice_ref_internal(value.slice)));
map->Set(Which(), Which::MementoToValue(
metadata_detail::SliceFromBuffer(value)));
return GRPC_ERROR_NONE;
},
// with_new_value
[](const Buffer&, Slice* value) {
const auto length = value->length();
return ParsedMetadata(Which(), Which::ParseMemento(std::move(*value)),
TransportSize(Which::key().length(), length));
[](Slice* value, ParsedMetadata* result) {
result->WithNewValueSetSlice<Which::ParseMemento>(value);
},
// debug_string
[](const Buffer& value) {
return absl::StrCat(
Which::key(), ": ",
Which::DisplayValue(Slice(grpc_slice_ref_internal(value.slice))));
}};
return metadata_detail::MakeDebugStringPipeline(
Which::key(), value, metadata_detail::SliceFromBuffer,
Which::DisplayValue);
},
// key_length
[](const Buffer&) { return Which::key().size(); },
};
return &vtable;
}
@ -294,16 +358,21 @@ ParsedMetadata<MetadataContainer>::MdelemVtable() {
return err;
},
// with_new_value
[](const Buffer& value, Slice* value_slice) {
return ParsedMetadata(grpc_mdelem_from_slices(
[](Slice* value_slice, ParsedMetadata* result) {
result->value_.mdelem = grpc_mdelem_from_slices(
static_cast<const ManagedMemorySlice&>(
grpc_slice_ref_internal(GRPC_MDKEY(value.mdelem))),
value_slice->TakeCSlice()));
grpc_slice_ref_internal(GRPC_MDKEY(result->value_.mdelem))),
value_slice->TakeCSlice());
},
// debug_string
[](const Buffer& value) {
return absl::StrCat(StringViewFromSlice(GRPC_MDKEY(value.mdelem)), ": ",
StringViewFromSlice(GRPC_MDVALUE(value.mdelem)));
return metadata_detail::MakeDebugString(
StringViewFromSlice(GRPC_MDKEY(value.mdelem)),
StringViewFromSlice(GRPC_MDVALUE(value.mdelem)));
},
// key_length
[](const Buffer& value) {
return GRPC_SLICE_LENGTH(GRPC_MDKEY(value.mdelem));
}};
return &vtable;
}

@ -35,506 +35,506 @@ StaticMetadata g_static_mdelem_table[GRPC_STATIC_MDELEM_COUNT] = {
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[3].base, 10,
g_static_metadata_bytes + 19),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
0),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[1].base, 7,
g_static_metadata_bytes + 5),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[39].base, 3,
g_static_metadata_bytes + 720),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[31].base, 3,
g_static_metadata_bytes + 603),
1),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[1].base, 7,
g_static_metadata_bytes + 5),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[40].base, 4,
g_static_metadata_bytes + 723),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[32].base, 4,
g_static_metadata_bytes + 606),
2),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[0].base, 5,
g_static_metadata_bytes + 0),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[41].base, 1,
g_static_metadata_bytes + 727),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[33].base, 1,
g_static_metadata_bytes + 610),
3),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[0].base, 5,
g_static_metadata_bytes + 0),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[42].base, 11,
g_static_metadata_bytes + 728),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[34].base, 11,
g_static_metadata_bytes + 611),
4),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[4].base, 7,
g_static_metadata_bytes + 29),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[43].base, 4,
g_static_metadata_bytes + 739),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[35].base, 4,
g_static_metadata_bytes + 622),
5),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[4].base, 7,
g_static_metadata_bytes + 29),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[44].base, 5,
g_static_metadata_bytes + 743),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[36].base, 5,
g_static_metadata_bytes + 626),
6),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7,
g_static_metadata_bytes + 12),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[45].base, 3,
g_static_metadata_bytes + 748),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[37].base, 3,
g_static_metadata_bytes + 631),
7),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7,
g_static_metadata_bytes + 12),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[46].base, 3,
g_static_metadata_bytes + 751),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[38].base, 3,
g_static_metadata_bytes + 634),
8),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7,
g_static_metadata_bytes + 12),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[47].base, 3,
g_static_metadata_bytes + 754),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[39].base, 3,
g_static_metadata_bytes + 637),
9),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7,
g_static_metadata_bytes + 12),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[48].base, 3,
g_static_metadata_bytes + 757),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[40].base, 3,
g_static_metadata_bytes + 640),
10),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7,
g_static_metadata_bytes + 12),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[49].base, 3,
g_static_metadata_bytes + 760),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[41].base, 3,
g_static_metadata_bytes + 643),
11),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7,
g_static_metadata_bytes + 12),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[50].base, 3,
g_static_metadata_bytes + 763),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[42].base, 3,
g_static_metadata_bytes + 646),
12),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[2].base, 7,
g_static_metadata_bytes + 12),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[51].base, 3,
g_static_metadata_bytes + 766),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[43].base, 3,
g_static_metadata_bytes + 649),
13),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[52].base, 14,
g_static_metadata_bytes + 769),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[44].base, 14,
g_static_metadata_bytes + 652),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
14),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[15].base, 15,
g_static_metadata_bytes + 184),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[53].base, 13,
g_static_metadata_bytes + 783),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[10].base, 15,
g_static_metadata_bytes + 108),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[45].base, 13,
g_static_metadata_bytes + 666),
15),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[54].base, 15,
g_static_metadata_bytes + 796),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[46].base, 15,
g_static_metadata_bytes + 679),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
16),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[55].base, 13,
g_static_metadata_bytes + 811),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[47].base, 13,
g_static_metadata_bytes + 694),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
17),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[56].base, 6,
g_static_metadata_bytes + 824),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[48].base, 6,
g_static_metadata_bytes + 707),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
18),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[57].base, 27,
g_static_metadata_bytes + 830),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[49].base, 27,
g_static_metadata_bytes + 713),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
19),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[58].base, 3,
g_static_metadata_bytes + 857),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[50].base, 3,
g_static_metadata_bytes + 740),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
20),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[59].base, 5,
g_static_metadata_bytes + 860),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[51].base, 5,
g_static_metadata_bytes + 743),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
21),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[60].base, 13,
g_static_metadata_bytes + 865),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[52].base, 13,
g_static_metadata_bytes + 748),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
22),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[61].base, 13,
g_static_metadata_bytes + 878),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[53].base, 13,
g_static_metadata_bytes + 761),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
23),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[62].base, 19,
g_static_metadata_bytes + 891),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[54].base, 19,
g_static_metadata_bytes + 774),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
24),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[14].base, 16,
g_static_metadata_bytes + 168),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 16,
g_static_metadata_bytes + 92),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
25),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[63].base, 16,
g_static_metadata_bytes + 910),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[55].base, 16,
g_static_metadata_bytes + 793),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
26),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[64].base, 14,
g_static_metadata_bytes + 926),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[56].base, 14,
g_static_metadata_bytes + 809),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
27),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[65].base, 16,
g_static_metadata_bytes + 940),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[57].base, 16,
g_static_metadata_bytes + 823),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
28),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[66].base, 13,
g_static_metadata_bytes + 956),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[58].base, 13,
g_static_metadata_bytes + 839),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
29),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[13].base, 12,
g_static_metadata_bytes + 156),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[8].base, 12,
g_static_metadata_bytes + 80),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
30),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[67].base, 6,
g_static_metadata_bytes + 969),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[59].base, 6,
g_static_metadata_bytes + 852),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
31),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[68].base, 4,
g_static_metadata_bytes + 975),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[60].base, 4,
g_static_metadata_bytes + 858),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
32),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[69].base, 4,
g_static_metadata_bytes + 979),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[61].base, 4,
g_static_metadata_bytes + 862),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
33),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[70].base, 6,
g_static_metadata_bytes + 983),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[62].base, 6,
g_static_metadata_bytes + 866),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
34),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[71].base, 7,
g_static_metadata_bytes + 989),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[63].base, 7,
g_static_metadata_bytes + 872),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
35),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[72].base, 4,
g_static_metadata_bytes + 996),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[64].base, 4,
g_static_metadata_bytes + 879),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
36),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[17].base, 4,
g_static_metadata_bytes + 229),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[65].base, 4,
g_static_metadata_bytes + 883),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
37),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[73].base, 8,
g_static_metadata_bytes + 1000),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[66].base, 8,
g_static_metadata_bytes + 887),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
38),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[74].base, 17,
g_static_metadata_bytes + 1008),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[67].base, 17,
g_static_metadata_bytes + 895),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
39),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[75].base, 13,
g_static_metadata_bytes + 1025),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[68].base, 13,
g_static_metadata_bytes + 912),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
40),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[76].base, 8,
g_static_metadata_bytes + 1038),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[69].base, 8,
g_static_metadata_bytes + 925),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
41),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[77].base, 19,
g_static_metadata_bytes + 1046),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[70].base, 19,
g_static_metadata_bytes + 933),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
42),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[78].base, 13,
g_static_metadata_bytes + 1065),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[71].base, 13,
g_static_metadata_bytes + 952),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
43),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[79].base, 4,
g_static_metadata_bytes + 1078),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[72].base, 4,
g_static_metadata_bytes + 965),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
44),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[80].base, 8,
g_static_metadata_bytes + 1082),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[73].base, 8,
g_static_metadata_bytes + 969),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
45),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[81].base, 12,
g_static_metadata_bytes + 1090),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[74].base, 12,
g_static_metadata_bytes + 977),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
46),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[82].base, 18,
g_static_metadata_bytes + 1102),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[75].base, 18,
g_static_metadata_bytes + 989),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
47),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[83].base, 19,
g_static_metadata_bytes + 1120),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[76].base, 19,
g_static_metadata_bytes + 1007),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
48),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[84].base, 5,
g_static_metadata_bytes + 1139),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[77].base, 5,
g_static_metadata_bytes + 1026),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
49),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[85].base, 7,
g_static_metadata_bytes + 1144),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[78].base, 7,
g_static_metadata_bytes + 1031),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
50),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[86].base, 7,
g_static_metadata_bytes + 1151),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[79].base, 7,
g_static_metadata_bytes + 1038),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
51),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[87].base, 11,
g_static_metadata_bytes + 1158),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[80].base, 11,
g_static_metadata_bytes + 1045),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
52),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[88].base, 6,
g_static_metadata_bytes + 1169),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[81].base, 6,
g_static_metadata_bytes + 1056),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
53),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[89].base, 10,
g_static_metadata_bytes + 1175),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[82].base, 10,
g_static_metadata_bytes + 1062),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
54),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[90].base, 25,
g_static_metadata_bytes + 1185),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[83].base, 25,
g_static_metadata_bytes + 1072),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
55),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[91].base, 17,
g_static_metadata_bytes + 1210),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[84].base, 17,
g_static_metadata_bytes + 1097),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
56),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[22].base, 10,
g_static_metadata_bytes + 320),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[85].base, 10,
g_static_metadata_bytes + 1114),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
57),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[92].base, 4,
g_static_metadata_bytes + 1227),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[86].base, 4,
g_static_metadata_bytes + 1124),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
58),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[93].base, 3,
g_static_metadata_bytes + 1231),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[87].base, 3,
g_static_metadata_bytes + 1128),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
59),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[94].base, 16,
g_static_metadata_bytes + 1234),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[88].base, 16,
g_static_metadata_bytes + 1131),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
60),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[6].base, 11,
g_static_metadata_bytes + 48),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[95].base, 1,
g_static_metadata_bytes + 1250),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[5].base, 11,
g_static_metadata_bytes + 36),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[89].base, 1,
g_static_metadata_bytes + 1147),
61),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[6].base, 11,
g_static_metadata_bytes + 48),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[23].base, 1,
g_static_metadata_bytes + 330),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[5].base, 11,
g_static_metadata_bytes + 36),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[15].base, 1,
g_static_metadata_bytes + 213),
62),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[6].base, 11,
g_static_metadata_bytes + 48),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[24].base, 1,
g_static_metadata_bytes + 331),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[5].base, 11,
g_static_metadata_bytes + 36),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[16].base, 1,
g_static_metadata_bytes + 214),
63),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[8].base, 13,
g_static_metadata_bytes + 75),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[96].base, 8,
g_static_metadata_bytes + 1251),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[6].base, 13,
g_static_metadata_bytes + 47),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[90].base, 8,
g_static_metadata_bytes + 1148),
64),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[8].base, 13,
g_static_metadata_bytes + 75),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[35].base, 4,
g_static_metadata_bytes + 695),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[6].base, 13,
g_static_metadata_bytes + 47),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 4,
g_static_metadata_bytes + 578),
65),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[8].base, 13,
g_static_metadata_bytes + 75),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[34].base, 7,
g_static_metadata_bytes + 688),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[6].base, 13,
g_static_metadata_bytes + 47),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[26].base, 7,
g_static_metadata_bytes + 571),
66),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[13].base, 12,
g_static_metadata_bytes + 156),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[97].base, 16,
g_static_metadata_bytes + 1259),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[8].base, 12,
g_static_metadata_bytes + 80),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[91].base, 16,
g_static_metadata_bytes + 1156),
67),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[4].base, 7,
g_static_metadata_bytes + 29),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[98].base, 4,
g_static_metadata_bytes + 1275),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[92].base, 4,
g_static_metadata_bytes + 1172),
68),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[1].base, 7,
g_static_metadata_bytes + 5),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[99].base, 3,
g_static_metadata_bytes + 1279),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[93].base, 3,
g_static_metadata_bytes + 1176),
69),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[15].base, 15,
g_static_metadata_bytes + 184),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[10].base, 15,
g_static_metadata_bytes + 108),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
70),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[14].base, 16,
g_static_metadata_bytes + 168),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[96].base, 8,
g_static_metadata_bytes + 1251),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 16,
g_static_metadata_bytes + 92),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[90].base, 8,
g_static_metadata_bytes + 1148),
71),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[14].base, 16,
g_static_metadata_bytes + 168),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[35].base, 4,
g_static_metadata_bytes + 695),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 16,
g_static_metadata_bytes + 92),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 4,
g_static_metadata_bytes + 578),
72),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[100].base, 11,
g_static_metadata_bytes + 1282),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 0,
g_static_metadata_bytes + 334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[94].base, 11,
g_static_metadata_bytes + 1179),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[19].base, 0,
g_static_metadata_bytes + 217),
73),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 20,
g_static_metadata_bytes + 88),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[96].base, 8,
g_static_metadata_bytes + 1251),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[7].base, 20,
g_static_metadata_bytes + 60),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[90].base, 8,
g_static_metadata_bytes + 1148),
74),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 20,
g_static_metadata_bytes + 88),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[34].base, 7,
g_static_metadata_bytes + 688),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[7].base, 20,
g_static_metadata_bytes + 60),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[26].base, 7,
g_static_metadata_bytes + 571),
75),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 20,
g_static_metadata_bytes + 88),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[101].base, 16,
g_static_metadata_bytes + 1293),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[7].base, 20,
g_static_metadata_bytes + 60),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[95].base, 16,
g_static_metadata_bytes + 1190),
76),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 20,
g_static_metadata_bytes + 88),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[35].base, 4,
g_static_metadata_bytes + 695),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[7].base, 20,
g_static_metadata_bytes + 60),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 4,
g_static_metadata_bytes + 578),
77),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 20,
g_static_metadata_bytes + 88),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[102].base, 13,
g_static_metadata_bytes + 1309),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[7].base, 20,
g_static_metadata_bytes + 60),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[96].base, 13,
g_static_metadata_bytes + 1206),
78),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 20,
g_static_metadata_bytes + 88),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[103].base, 12,
g_static_metadata_bytes + 1322),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[7].base, 20,
g_static_metadata_bytes + 60),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[97].base, 12,
g_static_metadata_bytes + 1219),
79),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[9].base, 20,
g_static_metadata_bytes + 88),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[104].base, 21,
g_static_metadata_bytes + 1334),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[7].base, 20,
g_static_metadata_bytes + 60),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[98].base, 21,
g_static_metadata_bytes + 1231),
80),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[15].base, 15,
g_static_metadata_bytes + 184),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[96].base, 8,
g_static_metadata_bytes + 1251),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[10].base, 15,
g_static_metadata_bytes + 108),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[90].base, 8,
g_static_metadata_bytes + 1148),
81),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[15].base, 15,
g_static_metadata_bytes + 184),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[35].base, 4,
g_static_metadata_bytes + 695),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[10].base, 15,
g_static_metadata_bytes + 108),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[27].base, 4,
g_static_metadata_bytes + 578),
82),
StaticMetadata(
StaticMetadataSlice(&g_static_metadata_slice_refcounts[15].base, 15,
g_static_metadata_bytes + 184),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[102].base, 13,
g_static_metadata_bytes + 1309),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[10].base, 15,
g_static_metadata_bytes + 108),
StaticMetadataSlice(&g_static_metadata_slice_refcounts[96].base, 13,
g_static_metadata_bytes + 1206),
83),
};
@ -978,17 +978,17 @@ uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 4, 6, 6, 8, 8, 2, 4, 4};
static const int8_t elems_r[] = {
15, 10, -8, 0, 2, -77, -42, 0, 9, -4, 0, 0, 0, 11, 0,
-7, 0, 5, 0, 0, 0, 0, -4, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, -63, 0, -47, -68, -48, -71, -72, 0,
30, 29, 28, 27, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17,
17, 16, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4,
3, 2, 1, 1, 2, 1, 0, 0, 0, 0, 0, -10, 0};
18, 11, -8, 0, -1, -46, 11, 0, 13, 10, 7, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, -51, 0, -54, -55, -56, -57, -58, -59, -60, -61, -62, -63,
0, 33, 32, 31, 30, 29, 29, 28, 27, 26, 25, 24, 23, 22,
21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8,
7, 6, 5, 4, 4, 3, 0, 0, 0, 0, 0, -8, 0};
static uint32_t elems_phash(uint32_t i) {
i -= 41;
uint32_t x = i % 103;
uint32_t y = i / 103;
i -= 33;
uint32_t x = i % 97;
uint32_t y = i / 97;
uint32_t h = x;
if (y < GPR_ARRAY_SIZE(elems_r)) {
uint32_t delta = static_cast<uint32_t>(elems_r[y]);
@ -998,25 +998,25 @@ static uint32_t elems_phash(uint32_t i) {
}
static const uint16_t elem_keys[] = {
255, 256, 257, 258, 259, 260, 261, 979, 980, 1602, 144, 145,
463, 464, 1497, 41, 42, 1610, 874, 875, 653, 654, 1505, 1392,
725, 1812, 2337, 5487, 5802, 6012, 6117, 6222, 6327, 6432, 6537, 1628,
6642, 6747, 6852, 6957, 7062, 7167, 7272, 7377, 7482, 7587, 7692, 5697,
7797, 7902, 5907, 8007, 8112, 8217, 8322, 8427, 8532, 8637, 8742, 8847,
8952, 9057, 9162, 9267, 9372, 9477, 9582, 518, 9687, 1041, 204, 9792,
9897, 10527, 1046, 1047, 1048, 1049, 1671, 0, 936, 0, 0, 1566,
1677, 0, 0, 342, 0, 0, 0, 0, 0, 1462};
235, 236, 237, 238, 239, 240, 241, 719, 720, 431, 432, 130,
131, 1009, 910, 811, 620, 621, 33, 34, 584, 1017, 918, 4375,
4573, 4672, 4771, 4870, 4969, 5068, 5167, 5266, 5365, 5464, 5563, 5662,
5761, 5860, 5959, 1035, 6058, 6157, 6256, 6355, 6454, 6553, 6652, 6751,
6850, 6949, 7048, 7147, 7246, 7345, 7444, 7543, 7642, 7741, 7840, 7939,
8038, 8137, 8236, 8335, 8434, 8533, 488, 8632, 8731, 9325, 0, 783,
0, 192, 0, 0, 788, 789, 790, 791, 684, 316, 0, 0,
1080, 981, 0, 883, 510, 511, 1086};
static const uint8_t elem_idxs[] = {
7, 8, 9, 10, 11, 12, 13, 75, 77, 70, 1, 2, 5, 6, 25, 3,
4, 82, 66, 65, 62, 63, 72, 30, 61, 37, 57, 14, 17, 19, 20, 21,
22, 23, 24, 15, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 38, 16,
39, 40, 18, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
54, 55, 56, 68, 58, 74, 69, 59, 60, 73, 76, 78, 79, 80, 81, 255,
64, 255, 255, 71, 83, 255, 255, 0, 255, 255, 255, 255, 255, 67};
7, 8, 9, 10, 11, 12, 13, 75, 77, 5, 6, 1, 2, 70, 25, 30,
66, 65, 3, 4, 61, 82, 72, 14, 16, 17, 18, 19, 20, 21, 22, 23,
24, 26, 27, 28, 29, 31, 32, 15, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
57, 58, 68, 59, 60, 73, 255, 74, 255, 69, 255, 255, 76, 78, 79, 80,
64, 0, 255, 255, 81, 71, 255, 67, 62, 63, 83};
grpc_mdelem grpc_static_mdelem_for_static_strings(intptr_t a, intptr_t b) {
if (a == -1 || b == -1) return GRPC_MDNULL;
uint32_t k = static_cast<uint32_t>(a * 105 + b);
uint32_t k = static_cast<uint32_t>(a * 99 + b);
uint32_t h = elems_phash(k);
return h < GPR_ARRAY_SIZE(elem_keys) && elem_keys[h] == k &&
elem_idxs[h] != 255

@ -264,22 +264,15 @@ typedef enum {
GRPC_BATCH_STATUS,
GRPC_BATCH_AUTHORITY,
GRPC_BATCH_SCHEME,
GRPC_BATCH_GRPC_MESSAGE,
GRPC_BATCH_GRPC_STATUS,
GRPC_BATCH_GRPC_PAYLOAD_BIN,
GRPC_BATCH_GRPC_ENCODING,
GRPC_BATCH_GRPC_ACCEPT_ENCODING,
GRPC_BATCH_GRPC_SERVER_STATS_BIN,
GRPC_BATCH_GRPC_TAGS_BIN,
GRPC_BATCH_GRPC_TRACE_BIN,
GRPC_BATCH_CONTENT_TYPE,
GRPC_BATCH_CONTENT_ENCODING,
GRPC_BATCH_ACCEPT_ENCODING,
GRPC_BATCH_GRPC_INTERNAL_ENCODING_REQUEST,
GRPC_BATCH_HOST,
GRPC_BATCH_GRPC_PREVIOUS_RPC_ATTEMPTS,
GRPC_BATCH_GRPC_RETRY_PUSHBACK_MS,
GRPC_BATCH_X_ENDPOINT_LOAD_METRICS_BIN,
GRPC_BATCH_CALLOUTS_COUNT
} grpc_metadata_batch_callouts_index;
@ -291,22 +284,15 @@ typedef union {
struct grpc_linked_mdelem* status;
struct grpc_linked_mdelem* authority;
struct grpc_linked_mdelem* scheme;
struct grpc_linked_mdelem* grpc_message;
struct grpc_linked_mdelem* grpc_status;
struct grpc_linked_mdelem* grpc_payload_bin;
struct grpc_linked_mdelem* grpc_encoding;
struct grpc_linked_mdelem* grpc_accept_encoding;
struct grpc_linked_mdelem* grpc_server_stats_bin;
struct grpc_linked_mdelem* grpc_tags_bin;
struct grpc_linked_mdelem* grpc_trace_bin;
struct grpc_linked_mdelem* content_type;
struct grpc_linked_mdelem* content_encoding;
struct grpc_linked_mdelem* accept_encoding;
struct grpc_linked_mdelem* grpc_internal_encoding_request;
struct grpc_linked_mdelem* host;
struct grpc_linked_mdelem* grpc_previous_rpc_attempts;
struct grpc_linked_mdelem* grpc_retry_pushback_ms;
struct grpc_linked_mdelem* x_endpoint_load_metrics_bin;
} named;
} grpc_metadata_batch_callouts;

@ -100,19 +100,16 @@ void OpenCensusCallTracer::OpenCensusCallAttemptTracer::
size_t tracing_len = TraceContextSerialize(context_.Context(), tracing_buf,
kMaxTraceContextLen);
if (tracing_len > 0) {
GRPC_LOG_IF_ERROR(
"census grpc_filter",
send_initial_metadata->Append(grpc_mdelem_from_slices(
GRPC_MDSTR_GRPC_TRACE_BIN,
grpc_core::UnmanagedMemorySlice(tracing_buf, tracing_len))));
send_initial_metadata->Set(grpc_core::GrpcTraceBinMetadata(),
grpc_core::Slice(grpc_core::UnmanagedMemorySlice(
tracing_buf, tracing_len)));
}
grpc_slice tags = grpc_empty_slice();
// TODO(unknown): Add in tagging serialization.
size_t encoded_tags_len = StatsContextSerialize(kMaxTagsLen, &tags);
if (encoded_tags_len > 0) {
GRPC_LOG_IF_ERROR("census grpc_filter",
send_initial_metadata->Append(grpc_mdelem_from_slices(
GRPC_MDSTR_GRPC_TAGS_BIN, tags)));
send_initial_metadata->Set(grpc_core::GrpcTagsBinMetadata(),
grpc_core::Slice(tags));
}
}
@ -129,14 +126,12 @@ void OpenCensusCallTracer::OpenCensusCallAttemptTracer::RecordReceivedMessage(
namespace {
void FilterTrailingMetadata(grpc_metadata_batch* b, uint64_t* elapsed_time) {
if (b->legacy_index()->named.grpc_server_stats_bin != nullptr) {
absl::optional<grpc_core::Slice> grpc_server_stats_bin =
b->Take(grpc_core::GrpcServerStatsBinMetadata());
if (grpc_server_stats_bin.has_value()) {
ServerStatsDeserialize(
reinterpret_cast<const char*>(GRPC_SLICE_START_PTR(
GRPC_MDVALUE(b->legacy_index()->named.grpc_server_stats_bin->md))),
GRPC_SLICE_LENGTH(
GRPC_MDVALUE(b->legacy_index()->named.grpc_server_stats_bin->md)),
elapsed_time);
b->Remove(b->legacy_index()->named.grpc_server_stats_bin);
reinterpret_cast<const char*>(grpc_server_stats_bin->data()),
grpc_server_stats_bin->size(), elapsed_time);
}
}

@ -39,8 +39,8 @@ namespace {
// server metadata elements
struct ServerMetadataElements {
grpc_slice path;
grpc_slice tracing_slice;
grpc_slice census_proto;
grpc_core::Slice tracing_slice;
grpc_core::Slice census_proto;
};
void FilterInitialMetadata(grpc_metadata_batch* b,
@ -49,15 +49,13 @@ void FilterInitialMetadata(grpc_metadata_batch* b,
sml->path = grpc_slice_ref_internal(
GRPC_MDVALUE(b->legacy_index()->named.path->md));
}
if (b->legacy_index()->named.grpc_trace_bin != nullptr) {
sml->tracing_slice = grpc_slice_ref_internal(
GRPC_MDVALUE(b->legacy_index()->named.grpc_trace_bin->md));
b->Remove(GRPC_BATCH_GRPC_TRACE_BIN);
auto grpc_trace_bin = b->Take(grpc_core::GrpcTraceBinMetadata());
if (grpc_trace_bin.has_value()) {
sml->tracing_slice = std::move(*grpc_trace_bin);
}
if (b->legacy_index()->named.grpc_tags_bin != nullptr) {
sml->census_proto = grpc_slice_ref_internal(
GRPC_MDVALUE(b->legacy_index()->named.grpc_tags_bin->md));
b->Remove(GRPC_BATCH_GRPC_TAGS_BIN);
auto grpc_tags_bin = b->Take(grpc_core::GrpcTagsBinMetadata());
if (grpc_tags_bin.has_value()) {
sml->census_proto = std::move(*grpc_tags_bin);
}
}
@ -91,24 +89,12 @@ void CensusServerCallData::OnDoneRecvInitialMetadataCb(
GPR_ASSERT(initial_metadata != nullptr);
ServerMetadataElements sml;
sml.path = grpc_empty_slice();
sml.tracing_slice = grpc_empty_slice();
sml.census_proto = grpc_empty_slice();
FilterInitialMetadata(initial_metadata, &sml);
calld->path_ = grpc_slice_ref_internal(sml.path);
calld->method_ = GetMethod(&calld->path_);
calld->qualified_method_ = absl::StrCat("Recv.", calld->method_);
const char* tracing_str =
GRPC_SLICE_IS_EMPTY(sml.tracing_slice)
? ""
: reinterpret_cast<const char*>(
GRPC_SLICE_START_PTR(sml.tracing_slice));
size_t tracing_str_len = GRPC_SLICE_IS_EMPTY(sml.tracing_slice)
? 0
: GRPC_SLICE_LENGTH(sml.tracing_slice);
GenerateServerContext(absl::string_view(tracing_str, tracing_str_len),
GenerateServerContext(sml.tracing_slice.as_string_view(),
calld->qualified_method_, &calld->context_);
grpc_slice_unref_internal(sml.tracing_slice);
grpc_slice_unref_internal(sml.census_proto);
grpc_slice_unref_internal(sml.path);
grpc_census_call_set_context(
calld->gc_, reinterpret_cast<census_context*>(&calld->context_));
@ -142,14 +128,9 @@ void CensusServerCallData::StartTransportStreamOpBatch(
size_t len = ServerStatsSerialize(absl::ToInt64Nanoseconds(elapsed_time_),
stats_buf_, kMaxServerStatsLen);
if (len > 0) {
GRPC_LOG_IF_ERROR(
"census grpc_filter",
grpc_metadata_batch_add_tail(
op->send_trailing_metadata()->batch(), &census_bin_,
grpc_mdelem_from_slices(
GRPC_MDSTR_GRPC_SERVER_STATS_BIN,
grpc_core::UnmanagedMemorySlice(stats_buf_, len)),
GRPC_BATCH_GRPC_SERVER_STATS_BIN));
op->send_trailing_metadata()->batch()->Set(
grpc_core::GrpcServerStatsBinMetadata(),
grpc_core::Slice(grpc_core::UnmanagedMemorySlice(stats_buf_, len)));
}
}
// Call next op.

@ -617,6 +617,7 @@ CORE_SOURCE_FILES = [
'src/core/lib/transport/error_utils.cc',
'src/core/lib/transport/metadata.cc',
'src/core/lib/transport/metadata_batch.cc',
'src/core/lib/transport/parsed_metadata.cc',
'src/core/lib/transport/pid_controller.cc',
'src/core/lib/transport/static_metadata.cc',
'src/core/lib/transport/status_conversion.cc',

@ -69,6 +69,15 @@
((sizeof(PFX_TOO_MUCH_METADATA_FROM_CLIENT_REQUEST) - 1) + \
(NUM_HEADERS * PFX_TOO_MUCH_METADATA_FROM_CLIENT_HEADER_SIZE) + 1)
static void verifier_fails(grpc_server* server, grpc_completion_queue* cq,
void* /*registered_method*/) {
while (grpc_core::Server::FromC(server)->HasOpenConnections()) {
GPR_ASSERT(grpc_completion_queue_next(
cq, grpc_timeout_milliseconds_to_deadline(20), nullptr)
.type == GRPC_QUEUE_TIMEOUT);
}
}
int main(int argc, char** argv) {
int i;
grpc_init();
@ -92,7 +101,7 @@ int main(int argc, char** argv) {
args[1].client_payload = client_payload;
args[1].client_payload_length = sizeof(client_payload) - 1;
grpc_run_bad_client_test(server_verifier_request_call, args, 2, 0);
grpc_run_bad_client_test(verifier_fails, args, 2, 0);
grpc_shutdown();
return 0;

@ -4,24 +4,16 @@
"\x07:status"
"\x0A:authority"
"\x07:scheme"
"\x0Cgrpc-message"
"\x0Bgrpc-status"
"\x10grpc-payload-bin"
"\x0Dgrpc-encoding"
"\x14grpc-accept-encoding"
"\x15grpc-server-stats-bin"
"\x0Dgrpc-tags-bin"
"\x0Egrpc-trace-bin"
"\x0Ccontent-type"
"\x10content-encoding"
"\x0Faccept-encoding"
"\x1Egrpc-internal-encoding-request"
"\x04host"
"\x1Agrpc-previous-rpc-attempts"
"\x16grpc-retry-pushback-ms"
"\x1Bx-endpoint-load-metrics-bin"
"\x0Cgrpc-timeout"
"\x0Auser-agent"
"\x011"
"\x012"
"\x013"
@ -72,6 +64,7 @@
"\x06expect"
"\x07expires"
"\x04from"
"\x04host"
"\x08if-match"
"\x11if-modified-since"
"\x0Dif-none-match"
@ -91,6 +84,7 @@
"\x0Aset-cookie"
"\x19strict-transport-security"
"\x11transfer-encoding"
"\x0Auser-agent"
"\x04vary"
"\x03via"
"\x10www-authenticate"

@ -35,7 +35,6 @@ TEST_F(EvaluateArgsTest, EmptyMetadata) {
EXPECT_EQ(args.GetPath(), nullptr);
EXPECT_EQ(args.GetMethod(), nullptr);
EXPECT_EQ(args.GetHost(), nullptr);
EXPECT_THAT(args.GetHeaders(), ::testing::ElementsAre());
EXPECT_EQ(args.GetHeaderValue("some_key", nullptr), absl::nullopt);
}
@ -57,16 +56,6 @@ TEST_F(EvaluateArgsTest, GetMethodSuccess) {
EXPECT_EQ(args.GetMethod(), "GET");
}
TEST_F(EvaluateArgsTest, GetHeadersSuccess) {
util_.AddPairToMetadata("host", "host123");
util_.AddPairToMetadata(":path", "/expected/path");
EvaluateArgs args = util_.MakeEvaluateArgs();
EXPECT_THAT(args.GetHeaders(),
::testing::UnorderedElementsAre(
::testing::Pair("host", "host123"),
::testing::Pair(":path", "/expected/path")));
}
TEST_F(EvaluateArgsTest, GetHeaderValueSuccess) {
util_.AddPairToMetadata("key123", "value123");
EvaluateArgs args = util_.MakeEvaluateArgs();

@ -31,20 +31,8 @@ bool leak_check = true;
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
grpc_init();
grpc_slice input = grpc_slice_from_copied_buffer((const char*)data, size);
absl::optional<grpc_slice> output;
output =
grpc_core::PercentDecodeSlice(input, grpc_core::PercentEncodingType::URL);
if (output.has_value()) {
grpc_slice_unref(*output);
}
output = grpc_core::PercentDecodeSlice(
input, grpc_core::PercentEncodingType::Compatible);
if (output.has_value()) {
grpc_slice_unref(*output);
}
grpc_slice_unref(grpc_core::PermissivePercentDecodeSlice(input));
grpc_slice_unref(input);
grpc_core::PermissivePercentDecodeSlice(
grpc_core::Slice::FromCopiedBuffer((const char*)data, size));
grpc_shutdown();
return 0;
}

@ -32,22 +32,13 @@ bool leak_check = true;
static void test(const uint8_t* data, size_t size,
grpc_core::PercentEncodingType type) {
grpc_init();
grpc_slice input =
grpc_slice_from_copied_buffer(reinterpret_cast<const char*>(data), size);
grpc_slice output = grpc_core::PercentEncodeSlice(input, type);
absl::optional<grpc_slice> decoded_output =
grpc_core::PercentDecodeSlice(output, type);
// encoder must always produce decodable output
GPR_ASSERT(decoded_output.has_value());
grpc_slice permissive_decoded_output =
grpc_core::PermissivePercentDecodeSlice(output);
// and decoded output must always match the input
GPR_ASSERT(grpc_slice_eq(input, *decoded_output));
GPR_ASSERT(grpc_slice_eq(input, permissive_decoded_output));
grpc_slice_unref(input);
grpc_slice_unref(output);
grpc_slice_unref(*decoded_output);
grpc_slice_unref(permissive_decoded_output);
auto input = grpc_core::Slice::FromCopiedBuffer(
reinterpret_cast<const char*>(data), size);
auto output = grpc_core::PercentEncodeSlice(input.Ref(), type);
auto permissive_decoded_output =
grpc_core::PermissivePercentDecodeSlice(std::move(output));
// decoded output must always match the input
GPR_ASSERT(input == permissive_decoded_output);
grpc_shutdown();
}

@ -29,10 +29,10 @@
#define TEST_VECTOR(raw, encoded, dict) \
test_vector(raw, sizeof(raw) - 1, encoded, sizeof(encoded) - 1, dict)
#define TEST_NONCONFORMANT_VECTOR(encoded, permissive_unencoded, dict) \
test_nonconformant_vector(encoded, sizeof(encoded) - 1, \
permissive_unencoded, \
sizeof(permissive_unencoded) - 1, dict)
#define TEST_NONCONFORMANT_VECTOR(encoded, permissive_unencoded) \
test_nonconformant_vector(encoded, sizeof(encoded) - 1, \
permissive_unencoded, \
sizeof(permissive_unencoded) - 1)
static void test_vector(const char* raw, size_t raw_length, const char* encoded,
size_t encoded_length,
@ -44,46 +44,32 @@ static void test_vector(const char* raw, size_t raw_length, const char* encoded,
gpr_free(raw_msg);
gpr_free(encoded_msg);
grpc_slice raw_slice = grpc_slice_from_copied_buffer(raw, raw_length);
grpc_slice encoded_slice =
grpc_slice_from_copied_buffer(encoded, encoded_length);
grpc_slice raw2encoded_slice = grpc_core::PercentEncodeSlice(raw_slice, type);
absl::optional<grpc_slice> encoded2raw_slice =
grpc_core::PercentDecodeSlice(encoded_slice, type);
GPR_ASSERT(encoded2raw_slice.has_value());
grpc_slice encoded2raw_permissive_slice =
grpc_core::PermissivePercentDecodeSlice(encoded_slice);
auto raw_slice = grpc_core::Slice::FromCopiedBuffer(raw, raw_length);
auto encoded_slice =
grpc_core::Slice::FromCopiedBuffer(encoded, encoded_length);
auto raw2encoded_slice = grpc_core::PercentEncodeSlice(raw_slice.Ref(), type);
auto encoded2raw_permissive_slice =
grpc_core::PermissivePercentDecodeSlice(encoded_slice.Ref());
char* raw2encoded_msg =
grpc_dump_slice(raw2encoded_slice, GPR_DUMP_HEX | GPR_DUMP_ASCII);
char* encoded2raw_msg =
grpc_dump_slice(*encoded2raw_slice, GPR_DUMP_HEX | GPR_DUMP_ASCII);
char* raw2encoded_msg = grpc_dump_slice(raw2encoded_slice.c_slice(),
GPR_DUMP_HEX | GPR_DUMP_ASCII);
char* encoded2raw_permissive_msg = grpc_dump_slice(
encoded2raw_permissive_slice, GPR_DUMP_HEX | GPR_DUMP_ASCII);
encoded2raw_permissive_slice.c_slice(), GPR_DUMP_HEX | GPR_DUMP_ASCII);
gpr_log(GPR_DEBUG,
"Result:\nraw2encoded = %s\nencoded2raw = %s\nencoded2raw_permissive "
"Result:\nraw2encoded = %s\nencoded2raw_permissive "
"= %s",
raw2encoded_msg, encoded2raw_msg, encoded2raw_permissive_msg);
raw2encoded_msg, encoded2raw_permissive_msg);
gpr_free(raw2encoded_msg);
gpr_free(encoded2raw_msg);
gpr_free(encoded2raw_permissive_msg);
GPR_ASSERT(grpc_slice_eq(raw_slice, *encoded2raw_slice));
GPR_ASSERT(grpc_slice_eq(raw_slice, encoded2raw_permissive_slice));
GPR_ASSERT(grpc_slice_eq(encoded_slice, raw2encoded_slice));
grpc_slice_unref(*encoded2raw_slice);
grpc_slice_unref(encoded2raw_permissive_slice);
grpc_slice_unref(raw2encoded_slice);
grpc_slice_unref(raw_slice);
grpc_slice_unref(encoded_slice);
GPR_ASSERT(raw_slice == encoded2raw_permissive_slice);
GPR_ASSERT(encoded_slice == raw2encoded_slice);
}
static void test_nonconformant_vector(const char* encoded,
size_t encoded_length,
const char* permissive_unencoded,
size_t permissive_unencoded_length,
grpc_core::PercentEncodingType type) {
size_t permissive_unencoded_length) {
char* permissive_unencoded_msg =
gpr_dump(permissive_unencoded, permissive_unencoded_length,
GPR_DUMP_HEX | GPR_DUMP_ASCII);
@ -94,28 +80,20 @@ static void test_nonconformant_vector(const char* encoded,
gpr_free(permissive_unencoded_msg);
gpr_free(encoded_msg);
grpc_slice permissive_unencoded_slice = grpc_slice_from_copied_buffer(
auto permissive_unencoded_slice = grpc_core::Slice::FromCopiedBuffer(
permissive_unencoded, permissive_unencoded_length);
grpc_slice encoded_slice =
grpc_slice_from_copied_buffer(encoded, encoded_length);
absl::optional<grpc_slice> encoded2raw_slice =
grpc_core::PercentDecodeSlice(encoded_slice, type);
GPR_ASSERT(!encoded2raw_slice.has_value());
grpc_slice encoded2raw_permissive_slice =
grpc_core::PermissivePercentDecodeSlice(encoded_slice);
auto encoded_slice =
grpc_core::Slice::FromCopiedBuffer(encoded, encoded_length);
auto encoded2raw_permissive_slice =
grpc_core::PermissivePercentDecodeSlice(std::move(encoded_slice));
char* encoded2raw_permissive_msg = grpc_dump_slice(
encoded2raw_permissive_slice, GPR_DUMP_HEX | GPR_DUMP_ASCII);
encoded2raw_permissive_slice.c_slice(), GPR_DUMP_HEX | GPR_DUMP_ASCII);
gpr_log(GPR_DEBUG, "Result:\nencoded2raw_permissive = %s",
encoded2raw_permissive_msg);
gpr_free(encoded2raw_permissive_msg);
GPR_ASSERT(
grpc_slice_eq(permissive_unencoded_slice, encoded2raw_permissive_slice));
grpc_slice_unref(permissive_unencoded_slice);
grpc_slice_unref(encoded2raw_permissive_slice);
grpc_slice_unref(encoded_slice);
GPR_ASSERT(permissive_unencoded_slice == encoded2raw_permissive_slice);
}
int main(int argc, char** argv) {
@ -135,10 +113,10 @@ int main(int argc, char** argv) {
TEST_VECTOR("\xff", "%FF", grpc_core::PercentEncodingType::URL);
TEST_VECTOR("\xee", "%EE", grpc_core::PercentEncodingType::URL);
TEST_VECTOR("%2", "%252", grpc_core::PercentEncodingType::URL);
TEST_NONCONFORMANT_VECTOR("%", "%", grpc_core::PercentEncodingType::URL);
TEST_NONCONFORMANT_VECTOR("%A", "%A", grpc_core::PercentEncodingType::URL);
TEST_NONCONFORMANT_VECTOR("%AG", "%AG", grpc_core::PercentEncodingType::URL);
TEST_NONCONFORMANT_VECTOR("\0", "\0", grpc_core::PercentEncodingType::URL);
TEST_NONCONFORMANT_VECTOR("%", "%");
TEST_NONCONFORMANT_VECTOR("%A", "%A");
TEST_NONCONFORMANT_VECTOR("%AG", "%AG");
TEST_NONCONFORMANT_VECTOR("\0", "\0");
grpc_shutdown();
return 0;
}

@ -33,14 +33,8 @@ class EvaluateArgsTestUtil {
~EvaluateArgsTestUtil() { delete channel_args_; }
void AddPairToMetadata(const char* key, const char* value) {
metadata_storage_.emplace_back();
auto& storage = metadata_storage_.back();
ASSERT_EQ(grpc_metadata_batch_add_tail(
&metadata_, &storage,
grpc_mdelem_from_slices(
grpc_slice_intern(grpc_slice_from_static_string(key)),
grpc_slice_intern(grpc_slice_from_static_string(value)))),
GRPC_ERROR_NONE);
metadata_.Append(
key, Slice(grpc_slice_intern(grpc_slice_from_static_string(value))));
}
void SetLocalEndpoint(absl::string_view local_uri) {
@ -63,7 +57,6 @@ class EvaluateArgsTestUtil {
private:
ScopedArenaPtr arena_ = MakeScopedArena(1024);
std::list<grpc_linked_mdelem> metadata_storage_;
grpc_metadata_batch metadata_{arena_.get()};
MockAuthorizationEndpoint endpoint_{/*local_uri=*/"", /*peer_uri=*/""};
grpc_auth_context auth_context_{nullptr};

@ -303,24 +303,20 @@ class MoreRepresentativeClientInitialMetadata {
GRPC_MDSTR_AUTHORITY,
grpc_slice_intern(grpc_slice_from_static_string(
"foo.test.google.fr:1234"))))));
GPR_ASSERT(GRPC_LOG_IF_ERROR(
"addmd",
b->Append(grpc_mdelem_from_slices(
GRPC_MDSTR_GRPC_TRACE_BIN,
grpc_slice_from_static_string("\x00\x01\x02\x03\x04\x05\x06\x07\x08"
"\x09\x0a\x0b\x0c\x0d\x0e\x0f"
"\x10\x11\x12\x13\x14\x15\x16\x17\x18"
"\x19\x1a\x1b\x1c\x1d\x1e\x1f"
"\x20\x21\x22\x23\x24\x25\x26\x27\x28"
"\x29\x2a\x2b\x2c\x2d\x2e\x2f"
"\x30")))));
GPR_ASSERT(GRPC_LOG_IF_ERROR(
"addmd",
b->Append(grpc_mdelem_from_slices(
GRPC_MDSTR_GRPC_TAGS_BIN,
grpc_slice_from_static_string("\x00\x01\x02\x03\x04\x05\x06\x07\x08"
"\x09\x0a\x0b\x0c\x0d\x0e\x0f"
"\x10\x11\x12\x13")))));
b->Set(grpc_core::GrpcTraceBinMetadata(),
grpc_core::Slice(grpc_core::StaticSlice::FromStaticString(
"\x00\x01\x02\x03\x04\x05\x06\x07\x08"
"\x09\x0a\x0b\x0c\x0d\x0e\x0f"
"\x10\x11\x12\x13\x14\x15\x16\x17\x18"
"\x19\x1a\x1b\x1c\x1d\x1e\x1f"
"\x20\x21\x22\x23\x24\x25\x26\x27\x28"
"\x29\x2a\x2b\x2c\x2d\x2e\x2f"
"\x30")));
b->Set(grpc_core::GrpcTagsBinMetadata(),
grpc_core::Slice(grpc_core::StaticSlice::FromStaticString(
"\x00\x01\x02\x03\x04\x05\x06\x07\x08"
"\x09\x0a\x0b\x0c\x0d\x0e\x0f"
"\x10\x11\x12\x13")));
GPR_ASSERT(GRPC_LOG_IF_ERROR(
"addmd",
b->Append(

@ -937,10 +937,11 @@ TEST_F(GrpcToolTest, CallCommandWithTimeoutDeadlineUpperBound) {
std::bind(PrintStream, &output_stream,
std::placeholders::_1)));
std::string output = output_stream.str();
// Expected output: "message: "true""
// deadline not greater than timeout + current time
EXPECT_TRUE(nullptr !=
strstr(output_stream.str().c_str(), "message: \"true\""));
EXPECT_TRUE(nullptr != strstr(output.c_str(), "message: \"true\"")) << output;
ShutdownServer();
}

@ -35,28 +35,20 @@ import perfection
CONFIG = [
# metadata strings
'host',
'grpc-timeout',
'grpc-internal-encoding-request',
'grpc-payload-bin',
':path',
'grpc-encoding',
'grpc-accept-encoding',
'user-agent',
':authority',
'grpc-message',
'grpc-status',
'grpc-server-stats-bin',
'grpc-tags-bin',
'grpc-trace-bin',
'grpc-previous-rpc-attempts',
'grpc-retry-pushback-ms',
'grpc-timeout',
'1',
'2',
'3',
'4',
'',
'x-endpoint-load-metrics-bin',
# well known method names
'/grpc.lb.v1.LoadBalancer/BalanceLoad',
'/envoy.service.load_stats.v2.LoadReportingService/StreamLoadStats',
@ -158,22 +150,15 @@ METADATA_BATCH_CALLOUTS = [
':status',
':authority',
':scheme',
'grpc-message',
'grpc-status',
'grpc-payload-bin',
'grpc-encoding',
'grpc-accept-encoding',
'grpc-server-stats-bin',
'grpc-tags-bin',
'grpc-trace-bin',
'content-type',
'content-encoding',
'accept-encoding',
'grpc-internal-encoding-request',
'host',
'grpc-previous-rpc-attempts',
'grpc-retry-pushback-ms',
'x-endpoint-load-metrics-bin',
]
COMPRESSION_ALGORITHMS = [

@ -2240,6 +2240,7 @@ src/core/lib/transport/metadata.cc \
src/core/lib/transport/metadata.h \
src/core/lib/transport/metadata_batch.cc \
src/core/lib/transport/metadata_batch.h \
src/core/lib/transport/parsed_metadata.cc \
src/core/lib/transport/parsed_metadata.h \
src/core/lib/transport/pid_controller.cc \
src/core/lib/transport/pid_controller.h \

@ -2041,6 +2041,7 @@ src/core/lib/transport/metadata.cc \
src/core/lib/transport/metadata.h \
src/core/lib/transport/metadata_batch.cc \
src/core/lib/transport/metadata_batch.h \
src/core/lib/transport/parsed_metadata.cc \
src/core/lib/transport/parsed_metadata.h \
src/core/lib/transport/pid_controller.cc \
src/core/lib/transport/pid_controller.h \

Loading…
Cancel
Save