On Thu, Jun 07, 2007 at 02:06:49AM +0300, Lucian Adrian Grijincu wrote:
> <snip from=man getaddrinfo(3)>
>       If hints.ai_flags  contains  the
>       AI_NUMERICHOST flag then the node parameter must be a numerical 
>       network
>       address.  The AI_NUMERICHOST flag suppresses  any  potentially  
>       lengthy
>       network host address lookups.
> </snip>
> 
> how does this work with string names like "localhost" too?

Eh, it doesn't, that's why it's got the word numeric in there ;-) But if
people want to translate literal IP addresses into addrinfo structures
regardless of connectivity - that's how to do it.

> As I understand the APR interface that's misbehaving now needs to
> support hostnames besides IPs represented as strings.

Very much so, that's the majority use-case by a long long way, it works
fine btw!

> Suppose that a this string is read from the commandline as a
> parameter. The app coder cannot pass this new APR_NUMERIC_ADDRESS
> flag, because he doesn't know if the string he received is a name for
> a link-local IP.

Firstly: I'm not sure what your point here is :-) That wouldn't be the
use-case.

Secondly: It's incredibly trivial to tell if a string is a literal IP
address or not, they are programatically distinguishable from hostnames
with extreme ease. But it'd be a bad idea to do that, still not the
use-case!

-- 
Colm MacCárthaigh                        Public Key: [EMAIL PROTECTED]

Reply via email to