traeak commented on code in PR #10897:
URL: https://github.com/apache/trafficserver/pull/10897#discussion_r1471270949


##########
src/proxy/http/HttpSessionManager.cc:
##########
@@ -151,52 +151,58 @@ ServerSessionPool::acquireSession(sockaddr const *addr, 
CryptoHash const &hostna
     // This is broken out because only in this case do we check the host hash 
first. The range must be checked
     // to verify an upstream that matches port and SNI name is selected. Walk 
backwards to select oldest.
     in_port_t port = ats_ip_port_cast(addr);
-    auto first     = m_fqdn_pool.find(hostname_hash);
-    while (first != m_fqdn_pool.end() && first->hostname_hash == 
hostname_hash) {
-      Debug("http_ss", "Compare port 0x%x against 0x%x", port, 
ats_ip_port_cast(first->get_remote_addr()));
-      if (port == ats_ip_port_cast(first->get_remote_addr()) &&
-          (!(match_style & TS_SERVER_SESSION_SHARING_MATCH_MASK_SNI) || 
validate_sni(sm, first->get_netvc())) &&
-          (!(match_style & TS_SERVER_SESSION_SHARING_MATCH_MASK_HOSTSNISYNC) 
|| validate_host_sni(sm, first->get_netvc())) &&
-          (!(match_style & TS_SERVER_SESSION_SHARING_MATCH_MASK_CERT) || 
validate_cert(sm, first->get_netvc()))) {
-        zret = HSM_DONE;
+    auto iter      = m_fqdn_pool.find(hostname_hash);

Review Comment:
   There are 2 different scopes, the iterators are different types (perhaps 
kill the auto and make it more explicit?).  Generally I only renamed "first" to 
"iter", and then moved the confusing zret logic down to the bottom of the 
function.



-- 
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: github-unsubscr...@trafficserver.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to