Rename http2 unpacker
These classes accidentally overlapped in naming with the nghttp2
classes. This is because this class, unlike most nghttp2 classes
doesn't end in _ptr for a type. This changes the class name to add a
_ex to differentiate the two classes, and avoid a warning in clang.
Tested: Unit tests pass. Code only used in unit test.
Change-Id: I91a6982264df69bc65166ab38feddc21f72cd223
Signed-off-by: Ed Tanous <ed@tanous.net>
diff --git a/http/nghttp2_adapters.hpp b/http/nghttp2_adapters.hpp
index 3235372..df230fe 100644
--- a/http/nghttp2_adapters.hpp
+++ b/http/nghttp2_adapters.hpp
@@ -11,7 +11,12 @@
/* This file contains RAII compatible adapters for nghttp2 structures. They
* attempt to be as close to a direct call as possible, while keeping the RAII
- * lifetime safety for the various classes.*/
+ * lifetime safety for the various classes. Because of this, they use the same
+ * naming as nghttp2, so ignore naming violations.
+ */
+
+// NOLINTBEGIN(readability-identifier-naming,
+// readability-make-member-function-const)
struct nghttp2_session;
@@ -160,12 +165,12 @@
nghttp2_session* ptr = nullptr;
};
-class nghttp2_hd_inflater
+struct nghttp2_hd_inflater_ex
{
nghttp2_hd_inflater* ptr = nullptr;
public:
- nghttp2_hd_inflater()
+ nghttp2_hd_inflater_ex()
{
if (nghttp2_hd_inflate_new(&ptr) != 0)
{
@@ -185,12 +190,12 @@
return nghttp2_hd_inflate_end_headers(ptr);
}
- nghttp2_hd_inflater(const nghttp2_hd_inflater&) = delete;
- nghttp2_hd_inflater& operator=(const nghttp2_hd_inflater&) = delete;
- nghttp2_hd_inflater& operator=(nghttp2_hd_inflater&&) = delete;
- nghttp2_hd_inflater(nghttp2_hd_inflater&& other) = delete;
+ nghttp2_hd_inflater_ex(const nghttp2_hd_inflater_ex&) = delete;
+ nghttp2_hd_inflater_ex& operator=(const nghttp2_hd_inflater_ex&) = delete;
+ nghttp2_hd_inflater_ex& operator=(nghttp2_hd_inflater_ex&&) = delete;
+ nghttp2_hd_inflater_ex(nghttp2_hd_inflater_ex&& other) = delete;
- ~nghttp2_hd_inflater()
+ ~nghttp2_hd_inflater_ex()
{
if (ptr != nullptr)
{
@@ -198,3 +203,5 @@
}
}
};
+// NOLINTEND(readability-identifier-naming,
+// readability-make-member-function-const)
diff --git a/test/http/http2_connection_test.cpp b/test/http/http2_connection_test.cpp
index 72f985c..7d6572c 100644
--- a/test/http/http2_connection_test.cpp
+++ b/test/http/http2_connection_test.cpp
@@ -51,7 +51,7 @@
void unpackHeaders(std::string_view dataField,
std::vector<std::pair<std::string, std::string>>& headers)
{
- nghttp2_hd_inflater inflater;
+ nghttp2_hd_inflater_ex inflater;
while (!dataField.empty())
{