You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by "Victor J. Orlikowski" <v....@gte.net> on 2001/07/23 20:41:48 UTC

gethostbyaddr, et alia

So, gethostbyname is handled by gethostbyname_r, and the corresponding
ifdefs....

Do we also need to handle gethostbyaddr and getservbyname in the same
manner, for thread safety's sake?

Also, I may be missing some history, but is there a reason that apr
does not yet have an apr_gethostbyname function?

Victor
-- 
Victor J. Orlikowski   | The Wall is Down, But the Threat Remains!
==================================================================
v.j.orlikowski@gte.net | orlikowski@apache.org | vjo@us.ibm.com

Re: gethostbyaddr, et alia

Posted by Justin Erenkrantz <je...@ebuilt.com>.
On Mon, Jul 23, 2001 at 09:08:07PM +0100, David Reid wrote:
> We do use getservbyname and I wondered about that today as well...  Also the
> gethostbyname_r on beos is broken in the current version (segfaults) but
> gethostbyname is thread safe so what's the best way of doing that - hints
> file?

Set GETHOSTBYNAME_IS_THREAD_SAFE in the hints file.  -- justin


Re: gethostbyaddr, et alia

Posted by David Reid <dr...@jetnet.co.uk>.
We do use getservbyname and I wondered about that today as well...  Also the
gethostbyname_r on beos is broken in the current version (segfaults) but
gethostbyname is thread safe so what's the best way of doing that - hints
file?

david
----- Original Message -----
From: "Jeff Trawick" <tr...@attglobal.net>
To: <v....@gte.net>
Cc: <de...@apr.apache.org>
Sent: Monday, July 23, 2001 8:08 PM
Subject: Re: gethostbyaddr, et alia


> "Victor J. Orlikowski" <v....@gte.net> writes:
>
> > Do we also need to handle gethostbyaddr and getservbyname in the same
> > manner, for thread safety's sake?
>
> when there is such a routine
>
> > Also, I may be missing some history, but is there a reason that apr
> > does not yet have an apr_gethostbyname function?
>
> see apr_sockaddr_info_get()
>
> --
> Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
>        http://www.geocities.com/SiliconValley/Park/9289/
>              Born in Roswell... married an alien...
>


Re: gethostbyaddr, et alia

Posted by "Victor J. Orlikowski" <v....@gte.net>.
Argh. Addressing to the list, plus some changes....

 > > Do we also need to handle gethostbyaddr and getservbyname in the same
 > > manner, for thread safety's sake?
 > 
 > when there is such a routine
 >

Can do.
 
 > > Also, I may be missing some history, but is there a reason that apr
 > > does not yet have an apr_gethostbyname function?
 > 
 > see apr_sockaddr_info_get()

Yes, I see. However...
What if we simply want to do a gethostbyname, without all the rest of
the rigmarole required to fill in the sockaddr?

Or, suppose I want to hold onto the hostent produced by the
gethostbyname (which we do, in the proxy, when we are handling
directly connected hosts)? apr_sockaddr_info_get() either uses
getaddrinfo or gethostbyname, preferring getaddrinfo if it is
available.

Or is this considered broken behavior, and should we learn to use the
apr_sockaddr_t, and like it? :)

Victor
-- 
Victor J. Orlikowski   | The Wall is Down, But the Threat Remains!
==================================================================
v.j.orlikowski@gte.net | orlikowski@apache.org | vjo@us.ibm.com

Re: gethostbyaddr, et alia

Posted by Jeff Trawick <tr...@attglobal.net>.
"Victor J. Orlikowski" <v....@gte.net> writes:

> Do we also need to handle gethostbyaddr and getservbyname in the same
> manner, for thread safety's sake?

when there is such a routine

> Also, I may be missing some history, but is there a reason that apr
> does not yet have an apr_gethostbyname function?

see apr_sockaddr_info_get()

-- 
Jeff Trawick | trawick@attglobal.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...