Mostly reasonable, just a few things to do better:

1) Do not use the "ink_" prefix, we're moving to "ats_".

2) It's not clear to me we need to wrap getaddrinfo at all unless you can 
simplify the api (e.g., ats_getbestaddrinfo).

3) Looking at the call sites which still use ink_gethostbyname, I would 
recommend converting them directly, one by one, and not trying to simulate the 
hostent at all. In fact, it looks like some of them can just be replaced by 
ats_getbestaddrinfo since they just take whatever is in slot 0 of the hostent.

4) Frankly, it looks like most of these are places I failed to convert to IPv6. 
At least the UrlRewrite.cc one, and probably the two in proxy/logging. 
(TS-1017). And maybe clustering (TS-990). Let me see what I have done for those.

Monday, March 26, 2012, 1:06:58 AM, you wrote:

> As a first step I will create a new function called ink_getaddrinfo().
> Next, I will rewrite ink_gethostbyname_r() and ink_gethostbyaddr_r() to
> wrap ink_getaddrinfo(), this will be tricky because I will need to manually
> create the hostent structs to not break existing code that uses
> ink_gethostbyname_r and inkgethostbyaddr_r, does that seem hacky? The nice
> thing about getaddrinfo is that it appears we will be able to get rid of
> several defines such as RENTRENT_GETHOSTBYNAME and GETHOSTBYNAME_R_GLIBC2
> since the API seems to be consistant across BSD, Linux, and Darwin, unless
> there is something i'm missing? Lastly, I will try to switch all usages of
> ink_gethostbyname/addr_r over to the new ink_getaddrinfo(), at which point
> I will remove them entirely.

> Thoughts?

> Brian

Reply via email to