Re: [HACKERS] pgsql: Add support for TCP keepalives on Windows, both for backend and

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-committers <pgsql-committers(at)postgresql(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] pgsql: Add support for TCP keepalives on Windows, both for backend and
Date: 2010-07-08 16:20:17
Message-ID: AANLkTikDrt3cm2v_bNVW_hFqok6zY51IA0Vi3ZOJF7cI@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Thu, Jul 8, 2010 at 18:06, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
> On Thu, Jul 8, 2010 at 17:45, Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
>>
>>
>> Tom Lane wrote:
>>>
>>> Magnus Hagander <magnus(at)hagander(dot)net> writes:
>>>
>>>>
>>>> Seems pretty simple - mingw doesn't have support for this. We have two
>>>> ways to deal with that I think:
>>>> 1) Disable it on mingw.
>>>> 2) Include it in our custom headers.
>>>>
>>>
>>>
>>>>
>>>> For #2, what we need to include is the define of SIO_KEEPALIVE_VALS as
>>>> well as the definition of struct tcp_keepalive.
>>>>
>>>
>>>
>>>>
>>>> We've done #2 before at least once, which worked well until mingw
>>>> suddenly caught up and added it a while later. It's not like this is a
>>>> new definition in windows, but we need to be ready for them to
>>>> eventually do that.
>>>>
>>>
>>> Yeah.  I'm satisfied with doing #1 and waiting for them to fix it.
>>>
>>>
>>>>
>>>> I guess there is:
>>>> 3) write an autoconf test and provide them only when mingw doesn't have
>>>> it.
>>>> if we're going with #3, I'll respectfully have to ask somebod yelse to
>>>> write the autoconf test, that's beyond me I think :-)
>>>>
>>>
>>> An easy approximation would be to make the code #ifdef SIO_KEEPALIVE_VALS.
>>> That would fail if the mingw guys decide to provide the #define without
>>> adding the struct at the same time, but that seems moderately unlikely.
>>>
>>>
>>>
>>
>> +1 for this course of action.
>
> Here's what I came up with and will apply as soon as my msvc build
> completes. (the mingw one works with this)

... and applied.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2010-07-08 16:30:13 pgsql: Add a cross-reference to precedence information to CREATE
Previous Message Magnus Hagander 2010-07-08 16:19:51 pgsql: Make the Windows tcp keepalive support depend on the existance of

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-07-08 16:29:47 Re: Reviewfest 2010-06 Plans and Call for Reviewers
Previous Message Tom Lane 2010-07-08 16:09:39 Re: Out of date comment in xlogutils.c