Re: contrib/sslinfo cleanup and OpenSSL errorhandling

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: contrib/sslinfo cleanup and OpenSSL errorhandling
Дата
Msg-id 20201030024714.GE1693@paquier.xyz
обсуждение исходный текст
Ответ на Re: contrib/sslinfo cleanup and OpenSSL errorhandling  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On Thu, Oct 29, 2020 at 04:40:32PM -0700, Andres Freund wrote:
> There's quite a few copies of this code that look exactly the same,
> except for the be_tls_get_* call. Do you see a way to have fewer copies
> of the same code?

Each one of those code paths is working on a different sub-API aiming
at fetching a specific piece of TLS information, and the way each
sub-API does its lookup at MyProcPort is different.  One possible way
would be to move the checks on ssl_in_use into a macro for the
beginning part.  The end part could be improved by making
X509_NAME_field_to_text() and such return a text and not a Datum, and
move the null check + text-to-datum conversion into a separate macro.
I am not sure if this would be an improvement in terms of readability
though.
--
Michael

Вложения

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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: [patch] Fix checksum verification in base backups for zero page headers
Следующее
От: Fujii Masao
Дата:
Сообщение: Re: Add statistics to pg_stat_wal view for wal related parameter tuning