Re: psql client does not handle WSAEWOULDBLOCK on Windows
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Paquier <michael@paquier.xyz>
Cc: Ning <ning94803@gmail.com>, pgsql-hackers@lists.postgresql.org,
Andrew Dunstan <andrew@dunslane.net>
Date: 2025-09-02T15:51:41Z
Lists: pgsql-hackers
Michael Paquier <michael@paquier.xyz> writes: > This is going to require some platform-specific check that I don't > have with me, though I am ready to accept that what you are telling > here is true and that we should apply this macro. Could somebody > check that a bit more in depth? Andrew D. perhaps? > One thing that I don't understand is why does this only apply after > the first call of pqsecure_raw_read() in gss_read()? There is a > second call of pqsecure_raw_read() you are not covering but it would > surely need the same treatment, no? > Also, what about pqsecure_raw_write() in pqsecure_open_gss()? > Shouldn't the same check apply? Yeah, I think we pretty much need to use SOCK_ERRNO, SOCK_ERRNO_SET, and SOCK_STRERROR (if relevant) throughout fe-secure-gssapi.c. Directly using errno is correct for syscalls related to the file system, but I think everything in this file is dealing with socket-related errors. Certainly the underlying pqsecure_raw_read and pqsecure_raw_write layer expects those macros to be used. Like you, I'm not really in a position to test this on Windows ... regards, tom lane
Commits
-
Use SOCK_ERRNO[_SET] in fe-secure-gssapi.c.
- fc287cf3c4c9 13.23 landed
- f46d77377b9a 14.20 landed
- ea78bd6d5d0f 19 (unreleased) landed
- d83879a32b48 18.1 landed
- 771b106d1994 15.15 landed
- 46c4478db421 16.11 landed
- 1c4671f7b7c3 17.7 landed