Re: psql client does not handle WSAEWOULDBLOCK on Windows

2024-12-09 Thread Michael Paquier
On Tue, Aug 06, 2024 at 04:01:42PM +0800, Ning wrote: > In the function of gss_read() if print the value of errno and SOCK_ERRNO > separately, I found the values are different: > *ret = pqsecure_raw_read(conn, recv_buffer, length); > if (*ret < 0) > { > printf("errno: %d\n", errno); > printf("resu

Re: psql client does not handle WSAEWOULDBLOCK on Windows

2024-08-06 Thread Ning
Hi Umar, In the function of gss_read() if print the value of errno and SOCK_ERRNO separately, I found the values are different: *ret = pqsecure_raw_read(conn, recv_buffer, length); if (*ret < 0) { printf("errno: %d\n", errno); printf("result_errno: %d\n", SOCK_ERRNO); ... errno: 0 result_errno:

Re: psql client does not handle WSAEWOULDBLOCK on Windows

2024-08-05 Thread Umar Hayat
I have not reproduce your test scenario, looking at code please see following comments: If you check the function definition of pqsecure_raw_read() it actually do set errno like bellow SOCK_ERRNO_SET(result_errno); where result_errno = SOCK_ERRNO Means anybody using those function pqsecure_raw

psql client does not handle WSAEWOULDBLOCK on Windows

2024-07-31 Thread Ning
*Description:*The connection fails with a non-blocking socket error when using psql on Windows to connect to a PostgreSQL server with GSSAPI enabled. The error is because the socket error code is obtained by WSAGetLastError() instead of errno. This causes the value of errno to be incorrect when han