Re: contrib/sslinfo cleanup and OpenSSL errorhandling - Mailing list pgsql-hackers

From Magnus Hagander
Subject Re: contrib/sslinfo cleanup and OpenSSL errorhandling
Date
Msg-id CABUevEyQQ=zZV8=q11dwRJaH8gEiz6gJBPBY296YL_=AXjwRXg@mail.gmail.com
Whole thread Raw
In response to Re: contrib/sslinfo cleanup and OpenSSL errorhandling  (Magnus Hagander <magnus@hagander.net>)
Responses Re: contrib/sslinfo cleanup and OpenSSL errorhandling  (Daniel Gustafsson <daniel@yesql.se>)
List pgsql-hackers
On Mon, Nov 2, 2020 at 3:19 PM Magnus Hagander <magnus@hagander.net> wrote:
>
> On Fri, Oct 30, 2020 at 11:20 PM Daniel Gustafsson <daniel@yesql.se> wrote:
> >
> > > On 30 Oct 2020, at 00:40, Andres Freund <andres@anarazel.de> 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?
> >
> > There's really only two of the same, and two sets of those.  I tried some
> > variations but didn't really achieve anything that would strike the right
> > balance on the codegolf-to-readability scale.  Maybe others have a richer
> > imagination than me.
>
> Yeah, since it's only 2 of each, moving it to a macro wouldn't really
> save a lot -- and it would make things less readable overall I think.
>
> So I'd say the current version is OK.
>
> One thing I noted was in the docs part of the patch there is a missing
> comma -- but that one is missing previously as well. I'll go apply
> that fix to the back branches while waiting to see if somebody comes
> up with a more creative way to avoid the repeated code :)

Applied, with the small adjustment of the comma in the docs.

I wonder if we should perhaps backpatch 0002? The changes to sslinfo
that were ported go all the way back to 9.6, so it should be a safe
one I think?

-- 
 Magnus Hagander
 Me: https://www.hagander.net/
 Work: https://www.redpill-linpro.com/



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: Parallel copy
Next
From: Magnus Hagander
Date:
Subject: Re: Move OpenSSL random under USE_OPENSSL_RANDOM