moonchen commented on code in PR #13737:
URL: https://github.com/apache/trafficserver/pull/13737#discussion_r4338850856
##########
src/iocore/net/Net.cc:
##########
@@ -43,12 +47,67 @@ int net_throttle_delay = 50; /* milliseconds */
std::string net_ccp_in;
std::string net_ccp_out;
+namespace
+{
+constexpr char THROTTLE_EXEMPT_LIST_VAR[] =
"proxy.config.net.connections_throttle_exempt_list";
+
+/** Parse a comma-separated list of IP addresses, networks, and ranges into @a
list.
+ *
+ * @return The first entry that does not parse, or an empty view if every
entry parses.
+ */
+swoc::TextView
+parse_throttle_exempt_list(std::string_view text, swoc::IPRangeSet &list)
+{
+ swoc::TextView entries{text};
+
+ while (!entries.empty()) {
+ swoc::TextView entry = entries.take_prefix_at(',').trim_if(&isspace);
+ swoc::IPRange range;
+
+ if (entry.empty()) {
+ continue;
+ }
+ if (!range.load(entry)) {
Review Comment:
Rebased onto the Uranium conversion and added the invalid-prefix tests:
`test_invalid_prefix_at_startup` and `test_invalid_prefix_on_reload`, each for
`192.0.2.1/256` and `2001:db8::1/256`. At startup the list is rejected and the
loopback address of that family is refused at the limit. On reload the previous
list stays in force. With #13756 reverted, all four fail.
--
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]