Re: Ipv6 network cleanup patch #2. - Mailing list pgsql-patches

From Kurt Roeckx
Subject Re: Ipv6 network cleanup patch #2.
Date
Msg-id 20030601231025.GA19271@ping.be
Whole thread Raw
In response to Re: Ipv6 network cleanup patch #2.  (Peter Eisentraut <peter_e@gmx.net>)
Responses Re: Ipv6 network cleanup patch #2.  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: Ipv6 network cleanup patch #2.  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-patches
On Sun, Jun 01, 2003 at 11:53:58PM +0200, Peter Eisentraut wrote:
> Could you explain what your patch changes to the rest of us?

The main idea behind the patch is to work protocol indepedent, so
you don't have to write code for each protocol.  This also means
reducing the use of things like HAVE_IPV6 and HAVE_UNIX_SOCKETS
to a minimum.

The right way to do that is using an API that supports that.  The
use of getaddrinfo and getnameinfo is the right way to do that,
while inet_ntop and inet_pton are not.  It was even changed
to SockAddr_ntop and pton to basicly do the same thing.

There already were some cleanups done that reduced the use of
HAVE_IPV6, because getaddrinfo2() was different in case you had
it or not.

You'll notice that the only place HAVE_IPV6 is used now is in
code that actually is related directly to network code.  It's all
in ip.c except for 2 small ones that check the family in hba.c
and getaddrinfo.c.

> Why did you change the test for HAVE_UNIX_SOCKETS?

Basicly, I've renamed HAVE_STRUCT_SOCKADDR_UN to
HAVE_UNIX_SOCKETS.  HAVE_STRUCT_SOCKADDR_UN wasn't used anywhere
anymore.  We don't need to have a struct sockaddr_un when the
system doesn't define it.  It's basicly the same as what we do
for HAVE_IPV6.

I also thing it's a better way to find out what system do have
unix domain sockets and which don't than by saying all except
those 3 have it.  Now you have to add them manually, while
configure can do it for you.  This was actually already changed
before the test changed for the win32 port.

If configure can do something for you, why don't you do it?


Any other comments?


Kurt


pgsql-patches by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: PGSQL translation to italian - Proposal n° 2
Next
From: Kurt Roeckx
Date:
Subject: Re: Ipv6 network cleanup patch #2.