Re: Serverside SNI support in libpq

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Gustafsson <daniel(at)yesql(dot)se>
Cc: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, Michael Banck <mbanck(at)gmx(dot)net>, Jacob Champion <jacob(dot)champion(at)enterprisedb(dot)com>, Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, "li(dot)evan(dot)chao" <li(dot)evan(dot)chao(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Andres Freund <andres(at)anarazel(dot)de>, Pgsql Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Serverside SNI support in libpq
Date: 2026-05-04 19:22:37
Message-ID: 359138.1777922557@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

In preparation for our annual pgindent update, I checked what happens
when I install the buildfarm's version of typedefs.list, and I found
that the typedef HostsFileLoadResult (from 4f433025f) gets
misformatted because it's not in the buildfarm's list. That's because
the buildfarm mechanism only captures typedefs that are used to
declare some object (variable, function, field) and this one isn't.

It seems quite odd to me that load_host(), which in fact returns
HostsFileLoadResult codes, is declared to return int. That seems
to have been done because HostsFileLoadResult wasn't declared in
the same header, but there is no visible reason why it shouldn't be.
Any objection to the attached fixup?

As a side matter, "load_host" seems like a remarkably generic name
that conveys little about what it actually does, and to the extent
that it does convey anything the implication is wrong: it returns
(potentially) info about multiple hosts not just one. Can't we do
better?

regards, tom lane

Attachment Content-Type Size
declare-load_host-more-honestly.patch text/x-diff 2.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2026-05-04 19:27:20 Re: Serverside SNI support in libpq
Previous Message David Geier 2026-05-04 18:29:47 Re: Avoid calling SetMatViewPopulatedState if possible