On Thu, Jan 9, 2025 at 8:17 AM Peter Eisentraut <pe...@eisentraut.org> wrote:
>
> Maybe it would work to just use plain "int" as the type here.  Any
> socket number must fit into int anyway in order for PQsocket() to be
> able to return it.  The way I understand Windows socket handles, this
> should work.

Looks like it should work for current Windows, yeah. This is the
approach taken by OpenSSL [1].

It'd be sad to copy-paste the API bug into a new place, though. If
we're going to disconnect this API from SOCKET, can we use uintptr_t
instead on Windows? If someone eventually adds an alternative to
PQsocket(), as Tom suggested in [2], it'd be nice not to have to
duplicate this callback too.

--Jacob

[1] https://docs.openssl.org/3.4/man3/SSL_set_fd/#notes
[2] https://www.postgresql.org/message-id/153442.1624889951%40sss.pgh.pa.us


Reply via email to