Re: pq_setkeepalives* functions
От | Bruce Momjian |
---|---|
Тема | Re: pq_setkeepalives* functions |
Дата | |
Msg-id | 201003131702.o2DH26u02537@momjian.us обсуждение исходный текст |
Ответ на | Re: pq_setkeepalives* functions (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: pq_setkeepalives* functions
(Tom Lane <tgl@sss.pgh.pa.us>)
|
Список | pgsql-hackers |
Tom Lane wrote: > Bruce Momjian <bruce@momjian.us> writes: > > Tom Lane wrote: > >> This makes the function *not* like the other two, rather than > >> improving consistency. > > > Well, it makes it like some of the existing functions, but not like > > others. This applied patch fixes them all. > > This is making things worse, not better. You have just changed the > behavior, and not in a good way. Formerly these were no-ops on > a unix socket connection, and now they can throw errors. Is this the proper way to fix the issue? Patch attached. -- Bruce Momjian <bruce@momjian.us> http://momjian.us EnterpriseDB http://enterprisedb.com PG East: http://www.enterprisedb.com/community/nav-pg-east-2010.do Index: src/backend/libpq/pqcomm.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/libpq/pqcomm.c,v retrieving revision 1.208 diff -c -c -r1.208 pqcomm.c *** src/backend/libpq/pqcomm.c 13 Mar 2010 16:56:37 -0000 1.208 --- src/backend/libpq/pqcomm.c 13 Mar 2010 17:01:14 -0000 *************** *** 1317,1326 **** int pq_getkeepalivesidle(Port *port) { - #ifdef TCP_KEEPIDLE if (port == NULL || IS_AF_UNIX(port->laddr.addr.ss_family)) return 0; if (port->keepalives_idle != 0) return port->keepalives_idle; --- 1317,1326 ---- int pq_getkeepalivesidle(Port *port) { if (port == NULL || IS_AF_UNIX(port->laddr.addr.ss_family)) return 0; + #ifdef TCP_KEEPIDLE if (port->keepalives_idle != 0) return port->keepalives_idle; *************** *** 1389,1398 **** int pq_getkeepalivesinterval(Port *port) { - #ifdef TCP_KEEPINTVL if (port == NULL || IS_AF_UNIX(port->laddr.addr.ss_family)) return 0; if (port->keepalives_interval != 0) return port->keepalives_interval; --- 1389,1398 ---- int pq_getkeepalivesinterval(Port *port) { if (port == NULL || IS_AF_UNIX(port->laddr.addr.ss_family)) return 0; + #ifdef TCP_KEEPINTVL if (port->keepalives_interval != 0) return port->keepalives_interval; *************** *** 1461,1470 **** int pq_getkeepalivescount(Port *port) { - #ifdef TCP_KEEPCNT if (port == NULL || IS_AF_UNIX(port->laddr.addr.ss_family)) return 0; if (port->keepalives_count != 0) return port->keepalives_count; --- 1461,1470 ---- int pq_getkeepalivescount(Port *port) { if (port == NULL || IS_AF_UNIX(port->laddr.addr.ss_family)) return 0; + #ifdef TCP_KEEPCNT if (port->keepalives_count != 0) return port->keepalives_count;
В списке pgsql-hackers по дате отправления: