|
|
|
@ -683,10 +683,12 @@ class HPackParser::String { |
|
|
|
|
return p->as_string_view(); |
|
|
|
|
} |
|
|
|
|
if (auto* p = absl::get_if<absl::Span<const uint8_t>>(&value_)) { |
|
|
|
|
return absl::string_view(reinterpret_cast<const char*>(p->data()), p->size()); |
|
|
|
|
return absl::string_view(reinterpret_cast<const char*>(p->data()), |
|
|
|
|
p->size()); |
|
|
|
|
} |
|
|
|
|
if (auto* p = absl::get_if<std::vector<uint8_t>>(&value_)) { |
|
|
|
|
return absl::string_view(reinterpret_cast<const char*>(p->data()), p->size()); |
|
|
|
|
return absl::string_view(reinterpret_cast<const char*>(p->data()), |
|
|
|
|
p->size()); |
|
|
|
|
} |
|
|
|
|
abort(); |
|
|
|
|
GPR_UNREACHABLE_CODE(return absl::string_view()); |
|
|
|
@ -1240,30 +1242,30 @@ class HPackParser::Parser { |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
Slice HPackParser::String::Take(Extern) { |
|
|
|
|
if (auto* p = absl::get_if<Slice>(&value_)) { |
|
|
|
|
return std::move(*p); |
|
|
|
|
} |
|
|
|
|
if (auto* p = absl::get_if<absl::Span<const uint8_t>>(&value_)) { |
|
|
|
|
return Slice::FromCopiedBuffer(*p); |
|
|
|
|
} |
|
|
|
|
if (auto* p = absl::get_if<std::vector<uint8_t>>(&value_)) { |
|
|
|
|
return Slice::FromCopiedBuffer(*p); |
|
|
|
|
} |
|
|
|
|
abort(); |
|
|
|
|
GPR_UNREACHABLE_CODE(return Slice()); |
|
|
|
|
if (auto* p = absl::get_if<Slice>(&value_)) { |
|
|
|
|
return std::move(*p); |
|
|
|
|
} |
|
|
|
|
if (auto* p = absl::get_if<absl::Span<const uint8_t>>(&value_)) { |
|
|
|
|
return Slice::FromCopiedBuffer(*p); |
|
|
|
|
} |
|
|
|
|
if (auto* p = absl::get_if<std::vector<uint8_t>>(&value_)) { |
|
|
|
|
return Slice::FromCopiedBuffer(*p); |
|
|
|
|
} |
|
|
|
|
abort(); |
|
|
|
|
GPR_UNREACHABLE_CODE(return Slice()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Slice HPackParser::String::Take(Intern) { |
|
|
|
|
ManagedMemorySlice m;
|
|
|
|
|
ManagedMemorySlice m; |
|
|
|
|
if (auto* p = absl::get_if<Slice>(&value_)) { |
|
|
|
|
m = ManagedMemorySlice(&p->c_slice()); |
|
|
|
|
} |
|
|
|
|
if (auto* p = absl::get_if<absl::Span<const uint8_t>>(&value_)) { |
|
|
|
|
m = ManagedMemorySlice(reinterpret_cast<const char*>(p->data()), p->size()); |
|
|
|
|
} |
|
|
|
|
if (auto* p = absl::get_if<std::vector<uint8_t>>(&value_)) { |
|
|
|
|
m = ManagedMemorySlice(reinterpret_cast<const char*>(p->data()), p->size()); |
|
|
|
|
} |
|
|
|
|
m = ManagedMemorySlice(&p->c_slice()); |
|
|
|
|
} |
|
|
|
|
if (auto* p = absl::get_if<absl::Span<const uint8_t>>(&value_)) { |
|
|
|
|
m = ManagedMemorySlice(reinterpret_cast<const char*>(p->data()), p->size()); |
|
|
|
|
} |
|
|
|
|
if (auto* p = absl::get_if<std::vector<uint8_t>>(&value_)) { |
|
|
|
|
m = ManagedMemorySlice(reinterpret_cast<const char*>(p->data()), p->size()); |
|
|
|
|
} |
|
|
|
|
return Slice(m); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|