This is an automated email from the ASF dual-hosted git repository.

bneradt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver-libswoc.git

commit e8c29e05acac14c17124137c303839596fc91973
Author: Brian Neradt <[email protected]>
AuthorDate: Mon Apr 14 17:31:39 2025 +0000

    proxy.config.http.per_client.connection.exempt_list
    
    This implements
    proxy.config.http.per_client.connection.exempt_list, a
    configuration for the user to be able to provide a set of IP addresses
    that are not counted against
    proxy.config.net.per_client.max_connections_in.
    
    This also adds the following TS APIs to modify this list via a plugin:
    
    TSConnectionLimitExemptListSet
    TSConnectionLimitExemptListAdd
    TSConnectionLimitExemptListClear
    
    (cherry picked from commit 8b85aa1b7f84abd084c5d21326f2821e1859dffb)
---
 code/include/swoc/IPRange.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/code/include/swoc/IPRange.h b/code/include/swoc/IPRange.h
index cdcf5b7..64740b3 100644
--- a/code/include/swoc/IPRange.h
+++ b/code/include/swoc/IPRange.h
@@ -1578,6 +1578,13 @@ public:
    */
   self_type &fill(swoc::IPRange const &r);
 
+  /** Erase addresses from the set.
+   *
+   * @param r Range of addresses to erase.
+   * @return @a this
+   */
+  self_type &erase(swoc::IPRange const &r);
+
   /// @return @c true if @a addr is in the set.
   bool contains(swoc::IPAddr const &addr) const;
 
@@ -1683,6 +1690,12 @@ IPRangeSet::fill(swoc::IPRange const &r) -> self_type & {
   return *this;
 }
 
+inline auto
+IPRangeSet::erase(swoc::IPRange const &r) -> self_type & {
+  _addrs.erase(r);
+  return *this;
+}
+
 inline bool
 IPRangeSet::contains(swoc::IPAddr const &addr) const {
   return _addrs.find(addr) != _addrs.end();

Reply via email to