Re: cvs: php-src /ext/sockets sockets.c
| From: | Wez Furlong | Date: | Tue, 08 Jul 2003 13:59:42 +0000 |
| Subject: | Re: cvs: php-src /ext/sockets sockets.c | ||
| References: | 1 2 3 4 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-22437@lists.php.net to get a copy of this message | ||
FYI: gethostbyname() is thread-safe under win32.
I have some code hanging around in my libwstreams repository
that implements getaddrinfo() using all the possible variations
of gethostbyname() or gethostbyname_r() (there are 3 possible
prototypes accepting 3, 5 or 6 parameters respectively!) for
IPV4 only systems.
I will be merging it into PHP once I've tidied it up fully, and
it should make for some nice readable resolving code at last.
--Wez.
----- Original Message -----
From: "Jason Greene" <jason@php.net>
To: "Sascha Schumann" <sascha@schumann.cx>
Cc: "Sara Golemon" <pollita@php.net>; <php-cvs@lists.php.net>
Sent: Tuesday, July 08, 2003 2:22 PM
Subject: Re: [PHP-CVS] cvs: php-src /ext/sockets sockets.c
> On Tue, 2003-07-08 at 08:15, Sascha Schumann wrote:
> > On Tue, 8 Jul 2003, Jason Greene wrote:
> >
> > > If the platform supports gethostbyname_r(most i know do), that is
thread
> > > safe.
> >
> > Note the "2" in the name.
> >
> > - Sascha
> I should have been more specific, we should change the ipv4 resolver
> code in sockets to use either getaddrinfo or gethostbyname_r, as it is
> currently not thread safe.
>
> The Ipv6 resolver code should just always use getaddrinfo
>
> -Jason