Re: Fix handling of invalid sockets returned by PQsocket()

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Fix handling of invalid sockets returned by PQsocket()
Дата
Msg-id CAB7nPqQ+vEdF8k28CBLwPKTQig2t+ki89bvwhgc4ixiSRCW7hQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Fix handling of invalid sockets returned by PQsocket()  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: Fix handling of invalid sockets returned by PQsocket()  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
On Thu, Feb 18, 2016 at 1:58 AM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:
> Michael Paquier wrote:
>> Hi all,
>>
>> After looking at Alvaro's message mentioning the handling of
>> PQsocket() for invalid sockets, I just had a look by curiosity at
>> other calls of this routine, and found a couple of issues:
>> 1) In vacuumdb.c, init_slot() does not check for the return value of PQsocket():
>> slot->sock = PQsocket(conn);
>> 2) In isolationtester.c, try_complete_step() should do the same.
>> 3) In pg_recvlogical.c for StreamLogicalLog() I am spotting the same problem.
>> I guess those ones should be fixed as well, no?
>
> I patched pgbench to use PQerrorMessage rather than strerror(errno).  I
> think your patch should do the same.

OK, this looks like a good idea. I would suggest doing the same in
receivelog.c then.
--
Michael

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: PostgreSQL Audit Extension
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: WIP: Access method extendability