Github user SolidWallOfCode commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/240#discussion_r33820620
  
    --- Diff: iocore/hostdb/HostDB.cc ---
    @@ -659,6 +660,21 @@ db_mark_for(IpAddr const &ip)
     HostDBInfo *
     probe(ProxyMutex *mutex, HostDBMD5 const &md5, bool ignore_timeout)
     {
    +  // If we have an entry in our hosts file, we don't need to bother with 
DNS
    +  Ptr<RefCountedHostsFileMap> current_host_file_map = 
hostDB.hosts_file_ptr;
    +
    +  ts::ConstBuffer hname(md5.host_name, md5.host_len);
    +  std::_Rb_tree_iterator<std::pair<const ts::ConstBuffer, IpAddr> > 
find_result = current_host_file_map->hosts_file_map.find(hname);
    --- End diff --
    
    It's not a good idea to dig around in the internals of `std::map`. The 
official way to do this is `std::map<ts::ConstBuffer, IpAddr, 
CmpConstBufferCaseInsensitive>::iterator`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to