Don’t assume `QuicheStringPiece::const_iterator` is a `const char*`

Explicitly convert a `QuicheStringPiece::const_iterator` to `const char*` before trying to initialize a `QuicheStringPiece` with it. This is technically required by the standard – `std::string_view` (to which `QuicheStringPiece` decays in C++17 mode) only has

std::string_view::string_view(const char*, size_t);
std::string_view::string_view(const char*);

and not

std::string_view::string_view(std::string_view::const_iterator);

In practice, this isn’t generally an issue, because most STL implementations use `const char*` as the `string_view` iterator type. MSVC, however, uses a struct for the iterator and therefore requires the explicit conversion.

Thanks go to Yifan Yang <needyyang@google.com>, who identified this issue.

PiperOrigin-RevId: 320031927
Change-Id: If81aff793fac2db7202b5df0d02f86147fc3a658
1 file changed
tree: 37c7e8b9f8ab02324d23787dc387bdf5a52feaa2
  1. common/
  2. epoll_server/
  3. http2/
  4. quic/
  5. spdy/
  6. CONTRIBUTING.md
  7. LICENSE
  8. README.md
README.md

QUICHE

QUICHE (QUIC, Http/2, Etc) is Google‘s implementation of QUIC and related protocols. It powers Chromium as well as Google’s QUIC servers and some other projects.