[ 
https://issues.apache.org/jira/browse/TS-3725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14617597#comment-14617597
 ] 

Gota Adachi commented on TS-3725:
---------------------------------

make fails by this commit.
{code:none}
make[2]: Entering directory 
`/var/home/admin/workspaces/workspece_ci/ci_trafficserver/repos/trafficserver/iocore/hostdb'
  CXX    HostDB.o
cc1plus: warnings being treated as errors
HostDB.cc: In constructor 'ShowHostDB::ShowHostDB(Continuation*, HTTPHdr*)':
HostDB.cc:2291: error: 'ShowHostDB::force' will be initialized after
HostDB.cc:2289: error:   'uint16_t ShowHostDB::port'
HostDB.cc:2391: error:   when initialized here
make[2]: *** [HostDB.o] Error 1
make[2]: Leaving directory 
`/var/home/admin/workspaces/workspece_ci/ci_trafficserver/repos/trafficserver/iocore/hostdb'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory 
`/var/home/admin/workspaces/workspece_ci/ci_trafficserver/repos/trafficserver/iocore'
make: *** [all-recursive] Error 1
{code}

Please fix like this:
{code:none}
diff --git a/iocore/hostdb/HostDB.cc b/iocore/hostdb/HostDB.cc
index 25628e8..8f428f4 100644
--- a/iocore/hostdb/HostDB.cc
+++ b/iocore/hostdb/HostDB.cc
@@ -2388,7 +2388,7 @@ struct ShowHostDB : public ShowCont {
   }
 
 
-  ShowHostDB(Continuation *c, HTTPHdr *h) : ShowCont(c, h), name(0), force(0), 
port(0)
+  ShowHostDB(Continuation *c, HTTPHdr *h) : ShowCont(c, h), name(0), port(0), 
force(0)
   {
     ats_ip_invalidate(&ip);
     SET_HANDLER(&ShowHostDB::showMain);
{code}

> ATS's use of host files is broken
> ---------------------------------
>
>                 Key: TS-3725
>                 URL: https://issues.apache.org/jira/browse/TS-3725
>             Project: Traffic Server
>          Issue Type: Bug
>    Affects Versions: 5.3.0, 6.0.0
>            Reporter: Thomas Jackson
>            Assignee: Thomas Jackson
>             Fix For: 6.0.0
>
>
> The previous implementation actually loaded up the hosts file (in a 
> background thread) and did a get (getbyname_imm) and then set the IPs to 
> match. This works-- but does cause a problem since the port set on it is 0.
> What we need to do is have this thread maintain in an in-memory mapping of 
> name -> ip and have it override resolution within hostdb-- that way we can 
> use host files and maintain whether reals are up or down.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to