diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-11 16:46:30 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-11 16:46:30 +0000 |
commit | 854010bc34484a22f5e97ed21ea76e76cde6a9ca (patch) | |
tree | e2fe43eaaa3546c62c0fce539d775f9928c805f4 /src/base64.h | |
parent | Adding debian version 1.61.0-1. (diff) | |
download | nghttp2-854010bc34484a22f5e97ed21ea76e76cde6a9ca.tar.xz nghttp2-854010bc34484a22f5e97ed21ea76e76cde6a9ca.zip |
Merging upstream version 1.62.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/base64.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/base64.h b/src/base64.h index 1bd51af..8789427 100644 --- a/src/base64.h +++ b/src/base64.h @@ -204,18 +204,19 @@ template <typename InputIt> std::string decode(InputIt first, InputIt last) { } template <typename InputIt> -StringRef decode(BlockAllocator &balloc, InputIt first, InputIt last) { +std::span<const uint8_t> decode(BlockAllocator &balloc, InputIt first, + InputIt last) { auto len = std::distance(first, last); if (len % 4 != 0) { - return StringRef::from_lit(""); + return {}; } auto iov = make_byte_ref(balloc, len / 4 * 3 + 1); - auto p = iov.base; + auto p = std::begin(iov); p = decode(first, last, p); *p = '\0'; - return StringRef{iov.base, p}; + return {std::begin(iov), p}; } } // namespace base64 |