Commit 7fb6cbcd authored by Poul-Henning Kamp's avatar Poul-Henning Kamp Committed by Dridi Boukelmoune

Remove a wrong vintage 2010 optimization (5f7d80c5)

Solaris, (remember Solaris?) will return connection related errnos
on fd metadata operations such as ioctl(2), [gs]etsockopt(2) etc.

We propagated these errors up from VTC_(non)blocking() which could,
theoretically, bail out earlier than it would otherwise have done.
This complicated code far more than it speeded anything up.

Instead just ensure that any errors returned are indeed connection
related, and then ignore them, and let Solaris deal with the broken
connection same way as other operating systems.
parent 43815427
......@@ -214,9 +214,11 @@ VTCP_fastopen(int sock, int depth)
* us to do two syscalls, one to get and one to set, the latter of
* which mucks about a bit before it ends up calling ioctl(FIONBIO),
* at least on FreeBSD.
* On Solaris ioctl(FIONBIO) can fail with connection related errnos,
* but as long as that is how they fail, we're fine.
*/
int
void
VTCP_blocking(int sock)
{
int i, j;
......@@ -224,10 +226,9 @@ VTCP_blocking(int sock)
i = 0;
j = ioctl(sock, FIONBIO, &i);
VTCP_Assert(j);
return (j);
}
int
void
VTCP_nonblocking(int sock)
{
int i, j;
......@@ -235,7 +236,6 @@ VTCP_nonblocking(int sock)
i = 1;
j = ioctl(sock, FIONBIO, &i);
VTCP_Assert(j);
return (j);
}
/*--------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment