summaryrefslogtreecommitdiff
path: root/src/node_http_common-inl.h
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2020-05-07 12:49:05 -0700
committerJames M Snell <jasnell@gmail.com>2020-05-14 08:56:41 -0700
commit241ed44a0b06db45c97681c164fc1098e7c9f0d2 (patch)
treedc8c790352d9bc3d6fe35cb69d9bb32aeefc556e /src/node_http_common-inl.h
parent1dafaf03cb35d51562193afab6e903a10a89d906 (diff)
downloadnode-new-241ed44a0b06db45c97681c164fc1098e7c9f0d2.tar.gz
src: small modification to NgHeader
This is separated out of the QUIC PR. It is not specific to QUIC but provides a new base class that is used there as an abstraction of the actual implementation. This is a purely internal implementation detail that has no outward functional changes (so no need for tests) Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/33289 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com>
Diffstat (limited to 'src/node_http_common-inl.h')
-rw-r--r--src/node_http_common-inl.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/node_http_common-inl.h b/src/node_http_common-inl.h
index 2c76dc3a1f..54f2faf39c 100644
--- a/src/node_http_common-inl.h
+++ b/src/node_http_common-inl.h
@@ -76,6 +76,14 @@ size_t GetServerMaxHeaderPairs(size_t max_header_pairs) {
return std::max(max_header_pairs, min_header_pairs);
}
+template <typename allocator_t>
+std::string NgHeaderBase<allocator_t>::ToString() const {
+ std::string ret = name();
+ ret += " = ";
+ ret += value();
+ return ret;
+}
+
template <typename T>
bool NgHeader<T>::IsZeroLength(
NgHeader<T>::rcbuf_t* name,
@@ -133,6 +141,12 @@ NgHeader<T>::NgHeader(NgHeader<T>&& other) noexcept
}
template <typename T>
+void NgHeader<T>::MemoryInfo(MemoryTracker* tracker) const {
+ tracker->TrackField("name", name_);
+ tracker->TrackField("value", value_);
+}
+
+template <typename T>
v8::MaybeLocal<v8::String> NgHeader<T>::GetName(
NgHeader<T>::allocator_t* allocator) const {