[Python-Dev] New branch for r23c2 work

Martin v. L÷wis martin@v.loewis.de
22 Jul 2003 08:12:56 +0200

Skip Montanaro <skip@pobox.com> writes:

> I've been thusfar unable to get the code in getaddrinfo.c to compile as part
> of socketmodule.c (errors about missing #defines and struct members).

And you shouldn't: OSX has its own implementation of getaddrinfo, so
you don't need the emulation code from getaddrinfo.c.

> Maybe the solution for the common case is easier.  In the common case of:
>     s = socket.socket (socket.AF_INET, socket.SOCK_STREAM) 
>     s.bind (('',0))
> when you get into setipaddr() name[0] will always be '\0' and so you'll take
> the first branch.  Do you need all of getaddrinfo()'s bells and whistles to
> properly set up addr_ret in this case?  At worst, can't the getaddrinfo()
> call be made once and then cached?

OTOH, we shouldn't work around performance problems on certain
systems. Instead, we should report them to the system vendors and wait
for fixes from them.

It's worse enough that we need to work around functional problems
(getaddrinfo not being thread-safe even though the spec says it should be).