masaori335 commented on code in PR #13236:
URL: https://github.com/apache/trafficserver/pull/13236#discussion_r3376904350
##########
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:
Right, this field adds the `.0` for HTTP/2 and HTTP/3.
--
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]