trafficserver-dev mailing list archives

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

    https://github.com/apache/trafficserver/pull/240#discussion_r33831438
  
    --- Diff: iocore/hostdb/HostDB.cc ---
    @@ -2771,11 +2586,14 @@ ParseHostLine(char *l)
       int n_elts = elts.Initialize(l, SHARE_TOKS);
       // Elements should be the address then a list of host names.
       // Don't use RecHttpLoadIp because the address *must* be literal.
    -  HostFilePair item;
    -  if (n_elts > 1 && 0 == item.ip.load(elts[0]) && !item.ip.isLoopback())
{
    +  IpAddr ip;
    +  if (n_elts > 1 && 0 == ip.load(elts[0]) && !ip.isLoopback()) {
         for (int i = 1; i < n_elts; ++i) {
    -      item.name = elts[i];
    -      HostFilePairs.push_back(item);
    +      ts::ConstBuffer name(elts[i], strlen(elts[i]));
    +      // If we don't have an entry already (host files only support single IPs for a
given name)
    --- End diff --
    
    It is from my local testing. I also checked around on google and there are quite a few
resources to back me up:
    
    - http://serverfault.com/questions/429839/assign-multiple-ips-to-1-entry-in-hosts-file
    - http://serverfault.com/questions/69836/point-multiple-ip-addresses-to-a-single-host-name
    - http://askubuntu.com/questions/48941/is-it-possible-to-give-two-ip-addresses-for-the-same-host-name


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