trafficserver-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From SolidWallOfCode <...@git.apache.org>
Subject [GitHub] trafficserver pull request: Maintain and use a mapping of hostname...
Date Thu, 02 Jul 2015 18:58:36 GMT
Github user SolidWallOfCode commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/240#discussion_r33811033
  
    --- Diff: iocore/hostdb/HostDB.cc ---
    @@ -659,6 +660,20 @@ 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;
    +
    +  std::string hname(md5.host_name);
    +  if (current_host_file_map->hosts_file_map.find(hname) != current_host_file_map->hosts_file_map.end())
{
    +    // TODO: Something to make this not local :/
    +    static HostDBInfo r;
    +    r.round_robin = false;
    +    r.reverse_dns = false;
    +    r.is_srv = false;
    +    ats_ip_set(r.ip(), current_host_file_map->hosts_file_map[hname]);
    --- End diff --
    
    No, save the iterator from the `find` so you don't have to search again.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message