summaryrefslogtreecommitdiffstats
path: root/src/base64.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-11 16:46:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-11 16:46:30 +0000
commit854010bc34484a22f5e97ed21ea76e76cde6a9ca (patch)
treee2fe43eaaa3546c62c0fce539d775f9928c805f4 /src/base64.h
parentAdding debian version 1.61.0-1. (diff)
downloadnghttp2-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.h9
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