public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: Ning <[email protected]>
Cc: [email protected]
Cc: Andrew Dunstan <[email protected]>
Subject: Re: psql client does not handle WSAEWOULDBLOCK on Windows
Date: Tue, 10 Dec 2024 15:41:02 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAFGqpvgJ_Y-POTgogbmzxTbUXrci3gLqcasw1rAZ4y2Wh+9+nA@mail.gmail.com>
References: <CAFGqpvg-pRw=cdsUpKYfwY6D3d-m9tw8WMcAEE7HHWfm-oYWvw@mail.gmail.com>
	<CAFGqpvgJ_Y-POTgogbmzxTbUXrci3gLqcasw1rAZ4y2Wh+9+nA@mail.gmail.com>

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("result_errno: %d\n", SOCK_ERRNO);
> ...

     *ret = pqsecure_raw_read(conn, recv_buffer, length);
     if (*ret < 0)
     {
-        if (errno == EAGAIN || errno == EWOULDBLOCK || errno == EINTR)
+        if (SOCK_ERRNO == EAGAIN || SOCK_ERRNO == EWOULDBLOCK || SOCK_ERRNO == EINTR)

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?
--
Michael


Attachments:

  [application/pgp-signature] signature.asc (833B, ../[email protected]/2-signature.asc)
  download

view thread (6+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: psql client does not handle WSAEWOULDBLOCK on Windows
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox