bneradt commented on code in PR #10688:
URL: https://github.com/apache/trafficserver/pull/10688#discussion_r1378304181
##########
src/iocore/net/ConnectionTracker.cc:
##########
@@ -139,37 +149,54 @@ Config_Update_Conntrack_Alert_Delay(const char *name,
RecDataT dtype, RecData da
} // namespace
void
-OutboundConnTrack::config_init(GlobalConfig *global, TxnConfig *txn)
+ConnectionTracker::config_init(GlobalConfig *global, TxnConfig *txn)
{
_global_config = global; // remember this for later retrieval.
// Per transaction lookup must be done at call time
because it changes.
- Enable_Config_Var(CONFIG_VAR_MIN, &Config_Update_Conntrack_Min, txn);
- Enable_Config_Var(CONFIG_VAR_MAX, &Config_Update_Conntrack_Max, txn);
- Enable_Config_Var(CONFIG_VAR_MATCH, &Config_Update_Conntrack_Match, txn);
- Enable_Config_Var(CONFIG_VAR_ALERT_DELAY,
&Config_Update_Conntrack_Alert_Delay, global);
+ Enable_Config_Var(CONFIG_SERVER_VAR_MIN, &Config_Update_Conntrack_Min, txn);
+ Enable_Config_Var(CONFIG_SERVER_VAR_MAX, &Config_Update_Conntrack_Max, txn);
+ Enable_Config_Var(CONFIG_SERVER_VAR_MATCH, &Config_Update_Conntrack_Match,
txn);
+ Enable_Config_Var(CONFIG_SERVER_VAR_ALERT_DELAY,
&Config_Update_Conntrack_Alert_Delay, global);
+}
+
+ConnectionTracker::TxnState
+ConnectionTracker::obtain_inbound(IpEndpoint const &addr)
+{
+ TxnState zret;
+ CryptoHash hash;
+ Group::Key key{addr, hash, MatchType::MATCH_IP};
+ std::lock_guard<std::mutex> lock(_imp._mutex); // Table lock
+ auto loc = _imp._table.find(key);
+ if (loc != _imp._table.end()) {
+ zret._g = loc;
+ } else {
+ zret._g = new Group(key, "", 0);
Review Comment:
I've now implemented Group deletion when all associated connections are gone.
--
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]