JosiahWI commented on code in PR #13543:
URL: https://github.com/apache/trafficserver/pull/13543#discussion_r3796391508
##########
include/iocore/net/NetHandler.h:
##########
@@ -113,30 +116,38 @@ class NetHandler : public Continuation, public
EThread::LoopTailHandler
/// configuration settings for managing the active and keep-alive queues
struct Config {
+ /// Identifies a config value, so an update can name it instead of passing
a pointer.
+ /// @note The underlying type is fixed and must not be narrowed. The index
arrives as
+ /// an untyped event cookie, and a value that wrapped would look like a
valid index.
+ enum class Index : int {
+ MAX_CONNECTIONS_IN,
+ MAX_REQUESTS_IN,
+ DEFAULT_INACTIVITY_TIMEOUT,
+ COUNT ///< Number of config values, not a valid index.
+ };
Review Comment:
The bitset initialization would be simpler if you set the enumeration values
to powers of two. What you did is good - just throwing the idea out there.
##########
src/iocore/net/unit_tests/test_NetHandler.cc:
##########
@@ -0,0 +1,60 @@
+/** @file
+
+ Catch based unit tests for NetHandler
+
+ @section license License
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ */
+
+#include <catch2/catch_test_macros.hpp>
+
+#include <cstddef>
+#include <cstdint>
+#include <set>
+
+#include "iocore/net/NetHandler.h"
Review Comment:
Nit: order should be local headers, then third party headers, then standard
headers, to expose missing includes early.
--
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]