bneradt commented on code in PR #13236:
URL: https://github.com/apache/trafficserver/pull/13236#discussion_r3374229501
##########
src/proxy/logging/unit-tests/test_LogAccess.cc:
##########
@@ -213,3 +214,21 @@ TEST_CASE("LogAccess non-HttpSM client host port is
null-safe", "[LogAccess]")
CHECK(access.marshal_client_host_port(nullptr) == INK_MIN_ALIGN);
CHECK(marshal_int_value([&](char *buf) { return
access.marshal_client_host_port(buf); }) == 4321);
}
+
+TEST_CASE("LogAccess unmarshal_http_version keeps the minor version",
"[LogAccess]")
+{
+ auto render = [](int64_t major, int64_t minor) -> std::string {
+ char marshalled[2 * INK_MIN_ALIGN];
+ LogAccess::marshal_int(marshalled, major);
+ LogAccess::marshal_int(marshalled + INK_MIN_ALIGN, minor);
+
+ char dest[64] = {};
+ char *src = marshalled;
+ int len = LogAccess::unmarshal_http_version(&src, dest,
sizeof(dest));
+ REQUIRE(len > 0);
+ return std::string(dest, len);
+ };
+
+ CHECK(render(1, 1) == "HTTP/1.1");
+ CHECK(render(1, 0) == "HTTP/1.0");
Review Comment:
Minor: can you also test HTTP/2.0 and HTTP/3.0 to make sure those are logged
as "HTTP/2.0" and "HTTP/3.0". I think `.0` should be suffixes for each of those.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]