Re: Potentially misleading name of libpq pass phrase hook

From: "Jonathan S(dot) Katz" <jkatz(at)postgresql(dot)org>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>, Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Potentially misleading name of libpq pass phrase hook
Date: 2020-05-16 14:33:50
Message-ID: 6124355d-ca04-219d-999f-76a5a4904df9@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 5/16/20 3:16 AM, Daniel Gustafsson wrote:
>> On 16 May 2020, at 03:56, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>>
>> On Fri, May 15, 2020 at 09:21:52PM -0400, Jonathan S. Katz wrote:
>>> +1 on all of the above.
>>>
>>> I noticed this has been added to Open Items; I added a note that the
>>> plan is to fix before the Beta 1 wrap.
>>
>> +1. Thanks.
>>
>> Agreed. PQsslKeyPassHook_<library>_type sounds fine to me as
>> convention. Wouldn't we want to also rename PQsetSSLKeyPassHook and
>> PQgetSSLKeyPassHook, appending an "_OpenSSL" to both?
>
> Yes, I think we should. The attached performs the rename of the hook functions
> and the type, and also fixes an off-by-one-'=' in a header comment which my OCD
> couldn't unsee.

Reviewed, overall looks good to me. My question is around the name. It
appears the convention is to do "openssl" on hooks[1], with the
convention being a single hook I could find. But scanning the codebase,
it appears we either use "OPENSSL" for definers and "openssl" in
function names.

So, my 2¢ is to use all lowercase to stick with convention.

Thanks!

Jonathan

[1]
https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/include/libpq/libpq-be.h;hb=HEAD#l293

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-05-16 14:46:57 Re: Our naming of wait events is a disaster.
Previous Message Ranier Vilela 2020-05-16 14:20:32 Re: calling procedures is slow and consumes extra much memory against calling function