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 20:07:31 GMT
Github user jacksontj commented on a diff in the pull request:

    https://github.com/apache/trafficserver/pull/240#discussion_r33817237
  
    --- Diff: iocore/hostdb/HostDB.cc ---
    @@ -2833,15 +2650,8 @@ ParseHostFile(char const *path)
         }
       }
     
    -  if (!HostFilePairs.empty()) {
    -    // Need to sort by name so multiple address hosts are
    -    // contiguous.
    -    std::sort(HostFilePairs.begin(), HostFilePairs.end(), &CmpHostFilePair);
    -    HostDBFileContinuation::scheduleUpdate(0);
    -  } else if (!HostFileKeys.empty()) {
    -    HostDBFileContinuation::scheduleRemove(-1, 0);
    -  } else {
    -    // Nothing in new data, nothing in old data, just clean up.
    -    HostDBFileContinuation::finish(0);
    -  }
    +  // Swap out hostDB's map for ours
    +  hostDB.hosts_file_ptr = parsed_hosts_file_ptr;
    +  // Make a new map, so we can do it all again
    +  parsed_hosts_file_ptr = new RefCountedHostsFileMap();
    --- End diff --
    
    I'm doing it so that the next load will have an empty one. Since the object is inited
in the constructor, this seems like a sensible place to clear it.


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