bneradt commented on code in PR #9539:
URL: https://github.com/apache/trafficserver/pull/9539#discussion_r1142325842


##########
proxy/http/HttpTransact.cc:
##########
@@ -1971,11 +1971,11 @@ HttpTransact::OSDNSLookup(State *s)
       action = s->http_config_param->redirect_actions_self_action;
       TxnDebug("http_trans", "[OSDNSLookup] Self action - %d.", int(action));
     } else {
-      // Make sure the return value from contains is big enough for a void*.
-      intptr_t x{intptr_t(RedirectEnabled::Action::INVALID)};
       ink_release_assert(s->http_config_param->redirect_actions_map != 
nullptr);
-      
ink_release_assert(s->http_config_param->redirect_actions_map->contains(s->dns_info.addr,
 reinterpret_cast<void **>(&x)));
-      action = static_cast<RedirectEnabled::Action>(x);
+      auto &addrs = *(s->http_config_param->redirect_actions_map);
+      auto spot   = addrs.find(swoc::IPAddr(&s->dns_info.addr.sa));
+      ink_release_assert(spot != addrs.end()); // Should always find an entry.
+      action = std::get<1>(*spot);

Review Comment:
   Maybe what you have is better with the explicit ink_release_assert. 



-- 
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]

Reply via email to