On Mon, Jul 07, 2003 at 12:38:57AM +0900, qhwt@myrealbox.com wrote:
>
> On Wed, Jul 02, 2003 at 03:49:19PM +0900, Kenji Sugita wrote:
> > It seems that a value of addr->ai_socktype returned by getaddrinfo in
> > pg_stat.c is not SOCK_DGRAM.
>
> Please try the following untested patch:
[...]
> + for (; addr != NULL; addr = addr->ai_next)
> + if ((pgStatSock = socket(addr->ai_family,
> + addr->ai_socktype, addr->ai_protocol)) >= 0)
> + break;
This will break. You should use a pointer to the addr, and go
over the list using that.
freeaddrinfo() needs to have the original addr back.
He seems to have 2 problems:
- On Mac OS X getaddrinfo() returns something it shouldn't.
A patch like that could fix it.
- On Linux Redhat 6.2 (and 6.0) getaddrinfo() seems to have a
problem with AI_ADDRCONFIG. Which is also used in
StreamServerPort(). So he won't be able to listen to any
socket there either.
Not being able to use AI_ADDRCONFIG is rather annoying, but I
guess if we just try all the returned addresses until 1 works
will have to do.
Try the attached patch instead.
Kurt