Return-Path: X-Original-To: apmail-trafficserver-dev-archive@www.apache.org Delivered-To: apmail-trafficserver-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 188BE18F0F for ; Thu, 2 Jul 2015 20:07:32 +0000 (UTC) Received: (qmail 8326 invoked by uid 500); 2 Jul 2015 20:07:31 -0000 Delivered-To: apmail-trafficserver-dev-archive@trafficserver.apache.org Received: (qmail 8262 invoked by uid 500); 2 Jul 2015 20:07:31 -0000 Mailing-List: contact dev-help@trafficserver.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@trafficserver.apache.org Delivered-To: mailing list dev@trafficserver.apache.org Received: (qmail 8250 invoked by uid 99); 2 Jul 2015 20:07:31 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Jul 2015 20:07:31 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 80BDAE365B; Thu, 2 Jul 2015 20:07:31 +0000 (UTC) From: jacksontj To: dev@trafficserver.apache.org Reply-To: dev@trafficserver.apache.org References: In-Reply-To: Subject: [GitHub] trafficserver pull request: Maintain and use a mapping of hostname... Content-Type: text/plain Message-Id: <20150702200731.80BDAE365B@git1-us-west.apache.org> Date: Thu, 2 Jul 2015 20:07:31 +0000 (UTC) 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. ---