summaryrefslogtreecommitdiffstats
path: root/src/http3.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-11 16:46:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-11 16:46:31 +0000
commite0d38508fc8b6bc3915b2235a85a068eacfb87bf (patch)
tree75de5a3a58d59b983ce82cde4f631a318cd6f13f /src/http3.cc
parentReleasing progress-linux version 1.61.0-1~progress7.99u1. (diff)
downloadnghttp2-e0d38508fc8b6bc3915b2235a85a068eacfb87bf.tar.xz
nghttp2-e0d38508fc8b6bc3915b2235a85a068eacfb87bf.zip
Merging upstream version 1.62.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/http3.cc')
-rw-r--r--src/http3.cc70
1 files changed, 2 insertions, 68 deletions
diff --git a/src/http3.cc b/src/http3.cc
index 61134ad..9bf33de 100644
--- a/src/http3.cc
+++ b/src/http3.cc
@@ -29,56 +29,6 @@ namespace nghttp2 {
namespace http3 {
namespace {
-nghttp3_nv make_nv_internal(const std::string &name, const std::string &value,
- bool never_index, uint8_t nv_flags) {
- uint8_t flags;
-
- flags = nv_flags |
- (never_index ? NGHTTP3_NV_FLAG_NEVER_INDEX : NGHTTP3_NV_FLAG_NONE);
-
- return {(uint8_t *)name.c_str(), (uint8_t *)value.c_str(), name.size(),
- value.size(), flags};
-}
-} // namespace
-
-namespace {
-nghttp3_nv make_nv_internal(const StringRef &name, const StringRef &value,
- bool never_index, uint8_t nv_flags) {
- uint8_t flags;
-
- flags = nv_flags |
- (never_index ? NGHTTP3_NV_FLAG_NEVER_INDEX : NGHTTP3_NV_FLAG_NONE);
-
- return {(uint8_t *)name.c_str(), (uint8_t *)value.c_str(), name.size(),
- value.size(), flags};
-}
-} // namespace
-
-nghttp3_nv make_nv(const std::string &name, const std::string &value,
- bool never_index) {
- return make_nv_internal(name, value, never_index, NGHTTP3_NV_FLAG_NONE);
-}
-
-nghttp3_nv make_nv(const StringRef &name, const StringRef &value,
- bool never_index) {
- return make_nv_internal(name, value, never_index, NGHTTP3_NV_FLAG_NONE);
-}
-
-nghttp3_nv make_nv_nocopy(const std::string &name, const std::string &value,
- bool never_index) {
- return make_nv_internal(name, value, never_index,
- NGHTTP3_NV_FLAG_NO_COPY_NAME |
- NGHTTP3_NV_FLAG_NO_COPY_VALUE);
-}
-
-nghttp3_nv make_nv_nocopy(const StringRef &name, const StringRef &value,
- bool never_index) {
- return make_nv_internal(name, value, never_index,
- NGHTTP3_NV_FLAG_NO_COPY_NAME |
- NGHTTP3_NV_FLAG_NO_COPY_VALUE);
-}
-
-namespace {
void copy_headers_to_nva_internal(std::vector<nghttp3_nv> &nva,
const HeaderRefs &headers, uint8_t nv_flags,
uint32_t flags) {
@@ -172,17 +122,12 @@ void copy_headers_to_nva_internal(std::vector<nghttp3_nv> &nva,
it_via = it;
break;
}
- nva.push_back(
- make_nv_internal(kv->name, kv->value, kv->no_index, nv_flags));
+ nva.push_back(make_field_flags(kv->name, kv->value,
+ nv_flags | never_index(kv->no_index)));
}
}
} // namespace
-void copy_headers_to_nva(std::vector<nghttp3_nv> &nva,
- const HeaderRefs &headers, uint32_t flags) {
- copy_headers_to_nva_internal(nva, headers, NGHTTP3_NV_FLAG_NONE, flags);
-}
-
void copy_headers_to_nva_nocopy(std::vector<nghttp3_nv> &nva,
const HeaderRefs &headers, uint32_t flags) {
copy_headers_to_nva_internal(
@@ -190,17 +135,6 @@ void copy_headers_to_nva_nocopy(std::vector<nghttp3_nv> &nva,
NGHTTP3_NV_FLAG_NO_COPY_NAME | NGHTTP3_NV_FLAG_NO_COPY_VALUE, flags);
}
-int check_nv(const uint8_t *name, size_t namelen, const uint8_t *value,
- size_t valuelen) {
- if (!nghttp3_check_header_name(name, namelen)) {
- return 0;
- }
- if (!nghttp3_check_header_value(value, valuelen)) {
- return 0;
- }
- return 1;
-}
-
} // namespace http3
} // namespace nghttp2