Re: TCP keepalive support for libpq
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Fujii Masao <masao.fujii@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>,
Magnus Hagander <magnus@hagander.net>, Euler Taveira de Oliveira <euler@timbira.com>, Marko Kreen <markokr@gmail.com>, Tollef Fog Heen <tollef.fog.heen@collabora.co.uk>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2010-06-23T20:56:07Z
Lists: pgsql-hackers
Fujii Masao <masao.fujii@gmail.com> writes: > On Wed, Jun 23, 2010 at 5:32 AM, Robert Haas <robertmhaas@gmail.com> wrote: >> OK, here's a new version with several fewer bugs. > Since valid values for keepalives parameter are 0 and 1, its field size should > be 1 rather than 10. Right ... although maybe it should be considered a boolean and not an int at all? > In this case, you can check the value of keepalives parameter by seeing > conn->keepalives[0] instead of using strtol() in useKeepalives(). I disagree with that idea, though. The field size has nothing to do with most of the possible sources of the variable's value ... regards, tom lane